view-types/Active Items
Active Items
As of v2.2.0, it is possible to associate any held item with an SMS menu, and "scroll" or execute it with the same controls as you would a normal (sign or map) view.
Active items are a little different from other view types:
- The menu details are stored as metadata on the item itself, and not in data persisted separately by the plugin.
- Active items do not have any view attributes.
- Active items do not have a view name and are not shown by the
/sms list
or/sms view
commands.
The ProtocolLib plugin is an optional but recommended dependency if you intend to use active items; you will get the following benefits:
- Active items will glow, as if enchanted.
- The item's lore is used to store some information about the item's SMS menu, on the last line of lore (the menu item tooltip, if any, is displayed on the rest of the item lore). While the menu information is coloured black, it's still visible on close inspection, and is visually jarring. With ProtocolLib installed, this line of menu information is hidden entirely (not sent to the client).
Permissions
To do anything with active items, you must have the scrollingmenusign.use.item permission node in addition to any other nodes needed for view management. E.g. to create an active item, you must also have the scrollingmenusign.commands.sync permision node.
Players do not have the scrollingmenusign.use.item by default, but the node is included in the scrollingmenusign.poweruser, scrollingmenusign.limited_admin and scrollingmenusign.admin parent nodes.
Creating an Active Item
Assuming you already have a menu named <menu-name>
:
- Hold the item you wish to turn into an active item.
- Type
/sms sync <menu-name> -item
- Your item will turn into an active item - its name will change to the menu title and the title of the first menu item in that menu.
If the item already had some custom metadata, the /sms sync
command will fail with a warning. If you're sure you want to override the current custom item name, re-run the command with the -force
option.
To create an active item, you must have the scrollingmenusign.commands.sync permision node.
Using an Active Item
Item usage is very much like using a sign or map view. The default bindings are:
- Right mouse button: scroll down
- Shift + Right mouse button: scroll up
- Shift + Mousewheel: scroll up or down
- Left mouse button: execute current menu item
(These bindings can be changed in the plugin configuration).
Submenus are fully supported by active items.
Removing an Active Item
To deactivate an active item:
- Hold the item in your hand
- Type
/sms break -item
- The item will turn back into an ordinary item with the default name for that item. Any previous item metadata is not preserved (hence the reason for the warning when creating items).
To deactivate an active item, you must have the scrollingmenusign.commands.break permision node.
Comments