Advertisement
Guest User

magicStick.yml

a guest
Apr 22nd, 2019
2,174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 7.63 KB | None | 0 0
  1. #####
  2. # From the Custom Items Minecraft Plugin — https://www.spigotmc.org/resources/63848/
  3. # By jojodmo — http://jojodmo.com
  4. #####
  5.  
  6. #####
  7. # Another custom item, but with handlers
  8. # This file is called magicstick.yml
  9. #####
  10.  
  11.  
  12.   # REQUIRED. The friendly name of the item
  13.   name: "Magic Stick"
  14.  
  15.   # REQUIRED. The Minecraft item the player gets.
  16.   item:
  17.    # REQUIRED. The Minecraft material name of the item
  18.     material: STICK
  19.  
  20.     # REQUIRED. The display name of the item
  21.     displayName: "&bMagic Stick"
  22.  
  23.     # OPTIONAL. A list of lore for the item
  24.     lore:
  25.      - "This right here"
  26.       - "Is a magic stick"
  27.  
  28. # OPTIONAL. Information about the item to be used in the information GUI
  29.   info:
  30.    # Valid info keys are description, usage, obtaining, and crafting
  31.     # The information for the crafting is automatically generated by the plugin. Only set it if you
  32.     # want to override the default GUI item.
  33.     description: "This is a magical stick"
  34.     usage: "This stick has certain magical properties. Experiment to figure out what it does!"
  35.     obtaining: "You can not get a magical stick"
  36.  
  37.   # OPTIONAL. This is where stuff gets interesting... Handlers!
  38.   # each item under the handlers tells the plugin to do something
  39.   # based on certain actions the player makes with the custom item.
  40.   # Handlers can also be added to native Minecraft items!
  41.   handlers:
  42.    # You can get a list of valid handlers in the item.yml quick reference
  43.     # On the plugin's spigotmc.org page
  44.  
  45.     # When the player right-clicks air
  46.     rightClickAir:
  47.       # Run the following actions. Formatting for this is very important, so pay close attention
  48.       actions:
  49.        # Start each new action with a -. and indent all children, like this.
  50.         -
  51.  
  52.           # REQUIRED. What to do to the player.
  53.           # You can get a list of valid options in the item.yml quick reference
  54.           # on the plugin's spigotmc.org page
  55.           action: sendMessages
  56.  
  57.           # OPTIONAL. Whether or not the messages should be prefixed with the prefix in the config.yml
  58.           # default: true
  59.           prefix: true
  60.  
  61.           # REQUIRED. Send the player the following messages
  62.           messages:
  63.            - "You just right-clicked with a magic stick"
  64.             - "This is the second message you're getting"
  65.  
  66.     # When the player right-clicks a block
  67.     rightClickBlock:
  68.       # Run these actions
  69.       actions:
  70.         # The start of a new action
  71.         -
  72.  
  73.           # Only run this action if the block clicked is in the following list (DIAMOND_BLOCK, EMERALD_BLOCK, GOLD_BLOCK)
  74.           # You can get a list of valid options in the item.yml quick reference
  75.           # on the plugin's spigotmc.org page
  76.           ifType:
  77.            - DIAMOND_BLOCK
  78.             - EMERALD_BLOCK
  79.             - GOLD_BLOCK
  80.  
  81.           # send the player a message
  82.           action: sendMessage
  83.           message: "You just right-clicked a diamond, emerald, or gold block!"
  84.  
  85.         # The start of a new action
  86.         -
  87.  
  88.           # Only run this action if the block clicked is DIRT
  89.           ifType: DIRT
  90.  
  91.           # Set the clicked block to the block below
  92.           action: setBlock
  93.  
  94.           # Set the block to a grass block
  95.           type: GRASS_BLOCK
  96.  
  97.     # When the player left-clicks a block
  98.     leftClickBlock:
  99.       # Run the following actions
  100.       actions:
  101.         # The start of a new action
  102.         -
  103.  
  104.           # Only run this action if the block clicked is a grass block
  105.           ifType: GRASS_BLOCK
  106.  
  107.           # Force the player to run commands...
  108.           action: playerRunCommands
  109.  
  110.           # Force the player to run these commands:
  111.           commands:
  112.            - "customitems plugin"
  113.             - "customitems inspect"
  114.  
  115.         # The start of a new action
  116.         -
  117.  
  118.           # Only run this action if the block clicked is a diamond block
  119.           ifType: DIAMOND_BLOCK
  120.  
  121.           # Force the console to run commands...
  122.           action: consoleRunCommands
  123.  
  124.           # Run the following commands. {player} is replaced with the name of the player who used the item.
  125.           # Thus, this will kick players who left-click a diamond block, and send a message to the server
  126.           commands:
  127.            - "kick {player} Never hit a diamond block with a magic stick!"
  128.             - "say {player} was just kicked for hitting a diamond block with a magic stick!"
  129.  
  130.         # The start of a new action
  131.         # This action will do the following:
  132.         # If the player hits a gold block, they will be sent a message telling them that they hit a gold block
  133.         # with a magic stick, then, if the player has the permission customitems.action.magicStickGoldToDiamond,
  134.         # the gold block will be turned into a diamond block, and the magic stick will be removed from
  135.         # their inventory.
  136.         -
  137.  
  138.           # Only run this action if the block clicked is a gold block
  139.           ifType: GOLD_BLOCK
  140.  
  141.           # runActions is special -- this will run all actions under actions, which is formatted just like
  142.           # the "actions" keys have been above. Again, formatting is very important
  143.           action: runActions
  144.  
  145.           # Run the following actions
  146.           actions:
  147.             # The start of a new action
  148.             -
  149.               # Send the player a message, where {player} is replaced with the player's name
  150.               action: sendMessage
  151.               message: "You just hit a gold block with a magic stick, {player}"
  152.  
  153.             # The start of a new action
  154.             -
  155.               # Only run this action if the player has the permission customitems.action.magicStickGoldToDiamond
  156.               # All permissions in ifHasPermission and ifNotHasPermission are automatically prefixed
  157.               # with customitems.action.
  158.               ifHasPermission: "magicStickGoldToDiamond"
  159.  
  160.               # Nested runActions! Run the following actions
  161.               action: runActions
  162.               actions:
  163.                 # The start of a new action
  164.                 -
  165.                   # cancel the block hit event
  166.                   # (if the player is in creative mode, they won't break the block they hit)
  167.                   action: cancel
  168.  
  169.                 # The start of a new action
  170.                 -
  171.                   # set the block clicked to DIAMOND_BLOCK
  172.                   action: setBlock
  173.                   type: DIAMOND_BLOCK
  174.  
  175.                 # The start of a new action
  176.                 -
  177.                   # remove the magic stick used from the player's hand
  178.                   action: destroyItemUsed
  179.  
  180.                   # OPTIONAL. the amount of items to remove from the player's hand
  181.                   # Set this to -1 to remove the entire stack from the player's hand
  182.                   # default: 1
  183.                   amount: 1
  184.  
  185.  
  186.     # When a player drops the item
  187.     drop:
  188.       # Run the following actions
  189.       actions:
  190.         # The start of a new action
  191.         -
  192.  
  193.           # Only run this action if the player DOESN'T have the permission customitems.action.canDropMagicStick
  194.           ifNotHasPermission: "canDropMagicStick"
  195.  
  196.           # the special runActions action
  197.           action: runActions
  198.  
  199.           # Run the following actions
  200.           actions:
  201.            # The start of a new action
  202.             -
  203.               # send the player a message "You can not drop a magical stick"
  204.               action: sendMessage
  205.               message: "You can not drop a magical stick"
  206.             # The start of a new action
  207.             -
  208.               # cancel the event -- the player will not drop the stick
  209.               action: cancel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement