Interact Items are the most basic Action Item there is. With an Interact Item you can define it to run defined actions on a specific click type. For example, making an item send a player a message with a 10 second cooldown when they right click it. Simple, right?
Now, let's go over the default interact item example.
SpeedPickaxe: # The name of the item action, can be anything
Type: "INTERACT" # The type of action item this is. Valid Types: INTERACT, ARMOR
Cooldown: 60 # The cooldown before they can run the action again, this is in seconds.
Bypass-Permission: "itemactions.speedpickaxe.bypass" # The permission to bypass the cooldown.
# Any information under this must be matched for the action to run from the item.
# It is recommended to just use the 'data-key' field for items, because it's the safest.
Item:
# A list of materials, if the item matches any it will be valid, learn more here (https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html)
Material: "DIAMOND_PICKAXE"
Name: "&eSpeed Pickaxe" # The items name
# A custom key that can be added to any item/entity, learn more here (https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/persistence/PersistentDataContainer.html)
# MUST be formatted plugin-name:data-key.
Data-Key: "itemactions:speed_pickaxe"
# The data value type
# Currently supports: INTEGER, STRING and DOUBLE
Data-Type: "STRING"
# The value of the data
# Must match the data-type field, for example INTEGER must be an integer.
# You still must make below value a string though, so even if it's an integer it would still be "1"
Data-Value: "1"
Requirements:
# The actual actions required to activate this item action (https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/Action.html)
Action-Types:
- "RIGHT_CLICK_AIR"
Permission: "itemactions.speedpickaxe" # The permission required to use this action, can be removed if no permission is needed
Actions: # Item actions, view valid actions on the wiki.
- "PLAY_SOUND:BLOCK_ANVIL_HIT"
- "RUN_COMMAND:say Must go FAST."
- "ADD_POTION_EFFECT:speed|3|true|true"