Editing Shops - Shopkeepers/Shopkeepers-Wiki GitHub Wiki

Once you have created your shop (admin or player), there are various actions you can perform to either customize your shop further, or delete it again. This page describes how editing of shops works in general, and what the available actions common to all shop types are.

Opening the "Editor Window"

By right-clicking on the shopkeeper while sneaking, you can open the shop's "Editor Window". This will look like a regular chest inventory, but it has a couple of special icons. Those represent buttons you can click to perform certain actions on the shopkeeper.

Example of the (empty) admin shop editor window:
images/setup/admin-shop-editor-empty.png

Renaming the shop

To set the shop's name, click the name tag and then type the new name into the chat.

The new name is validated according to the name-regex setting: This regular expression specifies the allowed characters, as well as the allowed minimum and maximum length of the name.

If wanted, the server admin can modify this name-regex setting by adding & and ยง to the list of allowed characters in order to allow the use of &-based color and formatting codes in shopkeeper names: For example, &cName will then result in a red Name.

Is is also possible to use hex color codes, either via Bukkit's hex format (&x&a&a&b&b&c&c), or using the more compact hex format (&#aabbcc). Internally, since Spigot only supports the Bukkit hex format in a few contexts, any user-specified compact hex color codes are automatically converted to the Bukkit hex format before the name is validated and applied to the shopkeeper.

Be aware that color codes count towards the maximum length of the shopkeeper name.

Changing the object variant

Some shop object types provide multiple variants you can select from inside the editor window. For example, for a villager shopkeeper you can cycle through the various villager professions and biome types by clicking the corresponding items.

Moving the shop

To move the shopkeeper to another location, click the enderpearl. The editor closes and you can then right-click a block to place the shopkeeper there. You can abort the action by left-clicking.

When you right-click a block to place the shopkeeper, we ignore interactions with some types of blocks that are relevant for navigation, such as doors, trap doors, fence doors, buttons, levers, etc. Other types of interactable blocks (work benches, chests, signs, etc.) are not ignored, because we want shopkeepers to be placeable against those (even if some plugins may use them for navigation purposes, e.g. command signs).

The shopkeeper is only moved if the clicked location is a valid spawn location, which depends on the shopkeeper and shop object type. The same placement restrictions apply as when you initially placed the shopkeeper: For example, player shopkeepers can only be placed in a certain radius around the shop container.

The moving of player shopkeepers can be disabled via the config setting enable-moving-of-player-shops.

Moving the shopkeeper also allows you to rotate it, as it is the case when you freshly created the shopkeeper: The placed shopkeeper will be rotated to face towards you. However, it is currently not possible to rotate the shopkeeper 'in-place', i.e. without first moving it to another location.

When sign post shopkeepers are enabled inside the config, moving a sign shop object will convert it between the sign post and wall sign variant depending on the block face you clicked.

Changing the mob equipment

The visual appereance of shopkeepers that are represented by a mob can be further customized by editing their equipment.

By default, the equipment can only be edited for mobs and slots that are known, at least for certain items, to visually affect the mob. If a mob is not visually affected by any equipment, the editor option to open the equipment editor is omitted.

If a mob already provides dedicated editor buttons for certain equipment slots (e.g. horse armor, llama carpet), we omit these slots from the equipment editor.

Admins can enable the setting enable-all-equipment-editor-slots (default: false) inside the config to enable the equipment editor for all mobs and all equipment slots, regardless of which equipment slots the mob actually supports. This can for example be useful for testing purposes. If the mob provides dedicated editor options for certain equipment slots, any non-empty equipment configured in the equipment editor takes precedence.

Additional notes:

  • There is no equipment editor yet for Citizens NPC shopkeepers.
  • You can also use placeholder items to equip the mob with items that you don't have available.
  • Vindicators: By default, vindicators don't support the mainhand slot, because they only render their item when they chase a target, which is not the case for shopkeeper mobs.
  • Mobs that usually burn in sunlight (zombies, skeletons, etc.): To reduce the amount of entity combust events that the plugin needs to handle, we automatically apply a small (invisible) default head item for these mobs. If a custom head item is configured inside the editor, the item from the editor is used instead. If the configured item is destructible, it is automatically made unbreakable to not break when it is exposed to the sunlight.
  • Enderman: You can configure the carried block of enderman shopkeepers by assigning a block item to the main hand slot.
    • Only items with a corresponding block type result in a block to be carried by the enderman.
    • You can also use placeholder items to specify the block type. This also allows you to use block types for which there doesn't exist a corresponding item (e.g. potted flowers).
    • Any block state data contained by the item (BlockStateTag / block_state component) is applied to the carried block. If the equipped item is a placeholder item, any contained block state data is applied to the substituted block type.
    • Some blocks do not properly render (e.g. player heads, signs, etc.).

Deleting the shop

If you want to delete the shopkeeper, you can click on the bone in the bottom-right corner. Be careful, there is no undo!

Setting up trades

The setup of trades works differently for each shop type. Information on that can be found at Admin Shop Setup and Player Shop Setup.