Skip to content
Fabricio20 edited this page Jan 26, 2020 · 2 revisions

HubBasics allows you to create custom items that execute certain tasks once used. These items are used in the Chest Menus and Join Items modules.

Each custom item needs a named yaml file on the Items folder. By default, HubBasics ships with two files example-1.yml and menu-opener.yml. The file name is treated as the ID of the item, this ID is the one you would use on the configuration of the Chest Menus or Join Items modules.

List of Configurations

A list of all available configurations is available below.

Material

This property specifies which Material this item represents (like a Compass or a Grass Block). A list of material names can be found at SpigotMC.

Required: This property is required for all items.

Example:

Material: COMPASS

Durability (or Metadata)

The durability of the item or MetaData (In Minecraft, Wool:1 has 1 as the metadata, which represents orange wool).

Example:

Durability: 1

Amount

Number of items on this stack.

Example:

Amount: 1

Name

Pretty name for the Item, supports color codes.

Example:

Name: '&aMenu Opener'

Description

Description, also known as Lore, a list of strings that goes on the Item's description. Supports color codes.

Example:

Description:
  - '&eMy purpose is to open'
  - '&ethe example menu'
  - '&7>Via right click'

Enchantments

List of item Enchantments, in the NAME:LEVEL format. A list of available enchantments can be found at SpigotMC.

Example:

Enchantments:
  - DAMAGE_ALL:10

Flags

List of Item Flags, like the HIDE_ENCHANTS (for hiding enchantment names). A list of available flags can be found at SpigotMC

Example:

Flags:
  - HIDE_ENCHANTS
  - HIDE_UNBREAKABLE

Permission

Permission node to receive (Join Items) and use this item.

Example:

Permission: some.permission.name

AllowDrop

Boolean specifying if the player should be allowed to drop this item from their inventory (or a chest menu).

Example:

AllowDrop: false

AllowMove

Boolean specifying if the player should be allowed to move this item around in their inventory (or a chest menu).

Example:

AllowMove: false

Slot

Specifies which slot this item should be placed on, this number has to be relative to where the item will be placed.

List of Inventory Numbers:

TIP: Using -1 here will make the item be added to the inventory, instead of replacing the item at the specific slot.

Example:

Slot: 5

Unbreakable

Boolean specifying if this item has the Unbreakable attribute.

Example:

Unbreakable: true

Run Commands

Toggle of where/how this item will trigger the executable commands.

Name Description
Inventory Trigger commands when the player clicks on this item in their inventory.
LeftClick Trigger commands when the player left clicks with this item in their hand.
RightClick Trigger commands when the player right clicks with this item in their hand.
AllowOffhand Enables RightClick and LeftClick for the OffHand. [1.9+]

Example:

RunCommands:
  AllowOffhand: false
  Inventory: false
  LeftClick: false
  RightClick: true

Commands

List of commands this item will run once it is triggered.

Modifiers are supported here as well as color codes and placeholders.

List of Modifiers:

  • "none": Without specifying a modifier, this command will be ran by the player normally.
  • op: This modifier runs the command as server Operator.
  • console: This modifier runs the command on the server console.
  • msg: This modifier sends a customizable message to the player.
  • warp: Teleports the player to a HubBasics Warp.
  • server: Transfers a player to another server (Requires BungeeCord).
  • open: Opens a Chest Menu.

Example:

Commands:
  - 'me hi' # Executes a command as the player
  - 'op:say Hi' # Executes a command as OP
  - 'console:say Hello' # Executes a command as the console
  - 'msg:CUSTOM_MESSAGE' # Sends a message to the player from the HubBasics Messages file.
  - 'msg:&aHello There &c${Player.Name}&a!' # Sends a custom message.
  - 'warp:Default'  # Warps to a HubBasics location
  - 'server:Lobby'  # Transfers the player to another Bungee server
  - 'open:MenuName' # Opens a Menu