Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #####
- # From the Custom Items Minecraft Plugin — https://www.spigotmc.org/resources/63848/
- # By jojodmo — http://jojodmo.com
- #####
- #####
- # Another custom item, but with handlers
- # This file is called magicstick.yml
- #####
- # REQUIRED. The friendly name of the item
- name: "Magic Stick"
- # REQUIRED. The Minecraft item the player gets.
- item:
- # REQUIRED. The Minecraft material name of the item
- material: STICK
- # REQUIRED. The display name of the item
- displayName: "&bMagic Stick"
- # OPTIONAL. A list of lore for the item
- lore:
- - "This right here"
- - "Is a magic stick"
- # OPTIONAL. Information about the item to be used in the information GUI
- info:
- # Valid info keys are description, usage, obtaining, and crafting
- # The information for the crafting is automatically generated by the plugin. Only set it if you
- # want to override the default GUI item.
- description: "This is a magical stick"
- usage: "This stick has certain magical properties. Experiment to figure out what it does!"
- obtaining: "You can not get a magical stick"
- # OPTIONAL. This is where stuff gets interesting... Handlers!
- # each item under the handlers tells the plugin to do something
- # based on certain actions the player makes with the custom item.
- # Handlers can also be added to native Minecraft items!
- handlers:
- # You can get a list of valid handlers in the item.yml quick reference
- # On the plugin's spigotmc.org page
- # When the player right-clicks air
- rightClickAir:
- # Run the following actions. Formatting for this is very important, so pay close attention
- actions:
- # Start each new action with a -. and indent all children, like this.
- -
- # REQUIRED. What to do to the player.
- # You can get a list of valid options in the item.yml quick reference
- # on the plugin's spigotmc.org page
- action: sendMessages
- # OPTIONAL. Whether or not the messages should be prefixed with the prefix in the config.yml
- # default: true
- prefix: true
- # REQUIRED. Send the player the following messages
- messages:
- - "You just right-clicked with a magic stick"
- - "This is the second message you're getting"
- # When the player right-clicks a block
- rightClickBlock:
- # Run these actions
- actions:
- # The start of a new action
- -
- # Only run this action if the block clicked is in the following list (DIAMOND_BLOCK, EMERALD_BLOCK, GOLD_BLOCK)
- # You can get a list of valid options in the item.yml quick reference
- # on the plugin's spigotmc.org page
- ifType:
- - DIAMOND_BLOCK
- - EMERALD_BLOCK
- - GOLD_BLOCK
- # send the player a message
- action: sendMessage
- message: "You just right-clicked a diamond, emerald, or gold block!"
- # The start of a new action
- -
- # Only run this action if the block clicked is DIRT
- ifType: DIRT
- # Set the clicked block to the block below
- action: setBlock
- # Set the block to a grass block
- type: GRASS_BLOCK
- # When the player left-clicks a block
- leftClickBlock:
- # Run the following actions
- actions:
- # The start of a new action
- -
- # Only run this action if the block clicked is a grass block
- ifType: GRASS_BLOCK
- # Force the player to run commands...
- action: playerRunCommands
- # Force the player to run these commands:
- commands:
- - "customitems plugin"
- - "customitems inspect"
- # The start of a new action
- -
- # Only run this action if the block clicked is a diamond block
- ifType: DIAMOND_BLOCK
- # Force the console to run commands...
- action: consoleRunCommands
- # Run the following commands. {player} is replaced with the name of the player who used the item.
- # Thus, this will kick players who left-click a diamond block, and send a message to the server
- commands:
- - "kick {player} Never hit a diamond block with a magic stick!"
- - "say {player} was just kicked for hitting a diamond block with a magic stick!"
- # The start of a new action
- # This action will do the following:
- # If the player hits a gold block, they will be sent a message telling them that they hit a gold block
- # with a magic stick, then, if the player has the permission customitems.action.magicStickGoldToDiamond,
- # the gold block will be turned into a diamond block, and the magic stick will be removed from
- # their inventory.
- -
- # Only run this action if the block clicked is a gold block
- ifType: GOLD_BLOCK
- # runActions is special -- this will run all actions under actions, which is formatted just like
- # the "actions" keys have been above. Again, formatting is very important
- action: runActions
- # Run the following actions
- actions:
- # The start of a new action
- -
- # Send the player a message, where {player} is replaced with the player's name
- action: sendMessage
- message: "You just hit a gold block with a magic stick, {player}"
- # The start of a new action
- -
- # Only run this action if the player has the permission customitems.action.magicStickGoldToDiamond
- # All permissions in ifHasPermission and ifNotHasPermission are automatically prefixed
- # with customitems.action.
- ifHasPermission: "magicStickGoldToDiamond"
- # Nested runActions! Run the following actions
- action: runActions
- actions:
- # The start of a new action
- -
- # cancel the block hit event
- # (if the player is in creative mode, they won't break the block they hit)
- action: cancel
- # The start of a new action
- -
- # set the block clicked to DIAMOND_BLOCK
- action: setBlock
- type: DIAMOND_BLOCK
- # The start of a new action
- -
- # remove the magic stick used from the player's hand
- action: destroyItemUsed
- # OPTIONAL. the amount of items to remove from the player's hand
- # Set this to -1 to remove the entire stack from the player's hand
- # default: 1
- amount: 1
- # When a player drops the item
- drop:
- # Run the following actions
- actions:
- # The start of a new action
- -
- # Only run this action if the player DOESN'T have the permission customitems.action.canDropMagicStick
- ifNotHasPermission: "canDropMagicStick"
- # the special runActions action
- action: runActions
- # Run the following actions
- actions:
- # The start of a new action
- -
- # send the player a message "You can not drop a magical stick"
- action: sendMessage
- message: "You can not drop a magical stick"
- # The start of a new action
- -
- # cancel the event -- the player will not drop the stick
- action: cancel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement