Skip to content

InventoryButton

Luis Benavides-Naranjo edited this page Mar 15, 2024 · 3 revisions

ItemStack

Action

Fields

  • All InventoryButtons have fields. If a required field is missing in the configuration, it will log it in console.
  • ❌ = Required
  • ✅ = Optional

  • ItemStack (The ItemStack to use) [❌]
    1. Background: # your InventoryButton key would be 'Background'
        ItemStack:
          Material: BLACK_STAINED_GLASS_PANE
          CustomModelData: 0
          DisplayName: ' '
          Lore: []
    2. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
  • Slot (The slots it will use in the inventory) [❌]
    1. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0 # will place it in the first slot of the inventory 
      Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: -1 # will disable the button from the inventory. don't do it on buttons like 'Background' or buttons that provide a range/set of slots, like the ones used in selectors
    2. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0-8 # will place it in the first 9 slots of the inventory
    3. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: '1-7,10-16' # will place it in the first 18 slots but skipping slots 0,8,9 and 17
  • Action (The action that's ran when clicked) [✅]
    1. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0
        Action: Gamemode.Creative # uses the Action with the key "Gamemode.Creative"
    2. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0
        Action:
          Action: 'gamemode creative %actor%' # %actor% in InventoryButtons are replaced by the player's name
          Action-Type: CONSOLE_COMMAND # will perform the action as a console command
    3. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0
        Action:
          Action: 'spawn'
          Action-Type: ACTOR_COMMAND # will perform the action as the actor, which in InventoryButtons is the player
  • Permission (The permission to check before doing logic) [✅]
    1. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0
        Permission: myServerLOLomgYOLO.admin # player will be required to have 'myServerLOLomgYOLO.admin' permission, otherwise no logic will be done
    2. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0
        Action: Gamemode.Creative
        Permission: myServerLOLomgYOLO.admin # player will be required to have 'myServerLOLomgYOLO.admin' permission, otherwise no logic will be done, like running the action that sets the player in creative mode
  • Price (The amount of money that player should have and that will be subtracted each time the button is interacted) [✅]
    1. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0
        Price: 500.0 # if player doesn't have 500.0, logic won't be done. If player has 500.0, logic will be done and player will be subtracted 500.0
    2. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0
        Permission:
        Price: 500.0
        Action:
          Action: 'weather clear'
          Action-Type: CONSOLE_COMMAND # if player had 500.0 and had myServerLOLomgYOLO.sunman permission, 500.0 will be subtracted and console will execute "/weather clear"
  • Price-Currency (The Vault currency name that will be used for the price field) [✅] Defaults to Vault's default currency
    1. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0
        Price-Currency: gold
        Price: 500.0 # if player doesn't have 500.0 'gold', logic won't be done. If player has 500.0 'gold', logic will be done and player will be subtracted 500.0 'gold'.
    2. Background: # your InventoryButton key would be 'Background'
        ItemStack: myServerLOLomgYOLO.background
        Slot: 0
        Permission:
        Price-Currency: gold
        Price: 500.0
        Action:
          Action: 'weather clear'
          Action-Type: CONSOLE_COMMAND # if player had 500.0 'gold' and had myServerLOLomgYOLO.sunman permission, 500.0 'gold' will be subtracted and console will execute "/weather clear"

Clone this wiki locally