CommandToItem [1.8-1.19] | Custom consumable command items icon

CommandToItem [1.8-1.19] | Custom consumable command items -----

Create items that when consumed, commands will be executed!




  • Added multiple item stack support in give command #9
    • Thank you to meowsome on GitHub for this addition
    • Please see the linked pull request for a full list of changes
See this link for configuration changes: https://github.com/LMBishop/Command...e040ff9c065bb11eeb6e30f35ba87694ea45d5ae6096c
----------, Aug 9, 2021

[​IMG]
  • New | Items can now require permissions
    • For example:
      Code (YAML):
       instant-death :
          ...
          # permission required (in this case commandtoitem.use.instant-death)
          options
      :
            permission-required
      : true
  • New | Items can now be configured to drop to the ground rather than be lost when giving one to a player with a full inventory.
    • Thanks to meowsome on GitHub for the addition
    • Config additons:
      Code (YAML):
      options :
        ...
        drop-if-full-inventory
      : false # If true and the player has a full inventory, drop the item at their feet. If false and the player has a full inventory, the item is lost.

      messages
      :
        ...
        receive-item-inventory-full
      : "&6You have been given %item%&6, but it was dropped at your feet because your inventory is full."
[​IMG]
----------, Feb 2, 2021

[​IMG]
  • Fix | The on-use.consume configuration field should now work.
[​IMG]
----------, Apr 14, 2020

[​IMG]
  • Fix | Fixed 1.13 items not properly working.
[​IMG]
----------, Apr 14, 2020

[​IMG]
  • New | Support for 1.8 has been added without affecting compatibility with newer 1.14+ features.
    • See the wiki for what sections of the config work with specific minecraft versions.
  • New | Items will show when autocompleting commands.
    • This fancy thing:
      [​IMG]
  • Fix | Enchantments will now be properly displayed on items.
    • For 1.13+, you must use the vanilla names and their namespace, example:
      Code (YAML):
      ...
          enchantments
      : # format: "{namespace}:{enchantment}:{level}"
            - "minecraft:infinity:1"
    • For older versions, you must use the spigot name, example:
      Code (YAML):
      ...
          enchantments
      : # format: {enchantment}:{level}"
            - "ARROW_INFINITY:1"
[​IMG]
----------, Apr 13, 2020

[​IMG]

  • New | (important, please read) CommandToItem now natively uses the 1.14 api, so it will be compatible with 1.14 blocks.
    • This also means that it cannot be used on versions before 1.14.
    • Item IDs no longer work as a result of this.
    • You may see a lot of stone blocks as the names for a lot of items have changed to their vanilla variant. This will require manual fixing. See this list for the names (ignore LEGACY blocks).
  • New | (important, please read) Changes to the configuration layout have been made.
    • Your current config layouts will be compatible for now, however I strongly recommend altering your configuration to the new layout.
    • All the following options should now be listed under the "on-use" section: consume, cooldown, commands, messages and sound.
    • Code (YAML):
      items:
        id
      :
          name
      : "name"
          item
      : WHEAT
          lore
      :
           - "lore"
          on-use
      :
            consume
      : true
            cooldown
      : 10
            messages
      :
             - "message1"
            commands
      :
             - "command1"
              - "command2"
            sound
      : "soundname"
    • This has been done to help prevent the config from becoming the mess as more features are added. The change to the layout properly seperates the tasks which will be done when an item is used from the actual information about the item itself.
    • See new default config here.
  • New | (incomplete) Wiki: https://github.com/LMBishop/CommandToItem/wiki/Configuration
  • New | CustomModelData support has been added.
    • Code (YAML):
      items :
        ...
        dodgy-apple
      :
          name
      : "&2&lDodgy Apple &7(Example Item)"
          item
      : APPLE
          # You can add custom model data
          custommodeldata
      : 12345
          lore
      :
           - "&7Something seems off about this apple..."
          on-use
      :
            commands
      :
             - "effect give %player% minecraft:poison 15 1"
  • New | AttributeModifier support has been added.
    • You should only really mess around with this if you know what you are doing. I myself still don't really know how it works.
    • Code (YAML):
      items :
        ...
        speed-boost
      :
          name
      : "&7&lSpeed Boost &7(Example Item)"
          item
      : SUGAR
          # You can also add attribute modifiers (not recommended if you don't know what you're doing & know how to use it in game)
          attributemodifiers
      :
            - attribute
      : GENERIC_MOVEMENT_SPEED # list -> https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html
              modifier
      :
                uuid
      : "49dc07dc-bfdb-4dc7-85d3-66ef52b51858" # uuid (/MUST/ BE UNIQUE! - https://www.uuidgenerator.net/)
                                                              # if unspecified, items will not work through restarts as a
                                                              # random one is generated each time the plugin is loaded
                name
      : "generic.movementSpeed"
                operation
      : ADD_NUMBER # list -> https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/AttributeModifier.Operation.html
                amount
      : 0.03
                equipmentslot
      : HAND # (optional) list -> https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/EquipmentSlot.html
            - attribute
      : GENERIC_MOVEMENT_SPEED
              modifier
      :
                uuid
      : "e22513cf-b15f-4443-9e2f-103c0ff9731b" # as said before, unique to the previous one
                name
      : "generic.movementSpeed"
                operation
      : ADD_NUMBER
                amount
      : 0.01
                equipmentslot
      : OFF_HAND
          lore
      :
           - "&7Hold this item for a minor speed boost,"
            - "&7or consume it for a bigger speed boost."
          on-use
      :
            commands
      :
             - "effect give %player% minecraft:speed 30 3"
            cooldown
      : 30
  • New | ItemFlag support has been added.
    • Code (YAML):
      items :
        ...
        instant-death
      :
          name
      : "&c&lInstant Death &7(Example Item)"
          item
      : SPIDER_EYE
          # You can give an item enchantments
          enchantments
      : # list -> https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.html
            - "ARROW_INFINITE:1"
          # + add the item flag to hide it
          itemflags
      : # list -> https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemFlag.html
            - "HIDE_ENCHANTS"
          lore
      :
           - "&7Instantly kills you"
          on-use
      :
            commands
      :
             - "kill %player%"
  • New | Unbreakable support has been added.
    • Code (YAML):
      items :
        ...
        name
      :
          ...
          unbreakable
      : true
[​IMG]
----------, Sep 29, 2019

[​IMG]
  • New | Support for sounds
    • You can now add sounds to be played when a player uses an item.
    • Code (YAML):
      items :
        ...
        weed
      :
          ...
         sound
      : "ITEM_FLINTANDSTEEL_USE"
       
    • Example config
[​IMG]
----------, Sep 26, 2019

[​IMG]
  • New | Cooldowns can now be added to items
    • Code (YAML):
      items :
        ...
        infinite-cookie
      :
          name
      : "&a&lMagic Cookie &7(Example Item)"
          item
      : COOKIE
          # You can prevent items from being taken away when clicked
          consume
      : false
          # You can also add a short cooldown to prevent it from being spammed
          cooldown
      : 60
          lore
      :
           - "&7Does not get consumed"
          commands
      :
           - "heal %player%"

      ...

      messages
      :
        ...
        cooldown
      : "&cYou must wait &4%cooldown% &cseconds before using this item again."
  • New | Consumption messages can now be added to items
    • These will be sent to the player when an item is used
    • Code (YAML):
       strength-sword:
          name
      : "&e&lInstant Strength &7(Example Item)"
          item
      : GOLD_SWORD
          # You can add messages which will be sent to the player upon consumption
          # You can use:
          #   %item% for the name of the item
          #   %player% for the players name
          #   %cooldown% for players new cooldown after use
          messages
      :
           - "&7&oYou feel a sudden rush of blood..."
          lore
      :
           - "&7Gives you Strength 4"
          commands
      :
           - "effect %player% 5 15 3"
  • Fix | A bug where an item would be used twice when looking at the ground has been fixed
[​IMG]
----------, Aug 24, 2019

[​IMG]
This is a complete recode of the plugin. Your old configuration will be compatible with this version, however you may want to add some lines to the bottom to get full functionality out of this update:
Code (YAML):
...

# Options here
options
:
  show-receive-message
: true

# Messages here
messages
:
  full-inv
: "&c%player%'s inventory is full!"
  give-item
: "&6Given &e%player% %item%&6."
  receive-item
: "&6You have been given %item%&6."
  • New | Customisable messages
    • You can now change the receive and give messages (see above).
    • You can now disable the receive message (see above).
  • New | Consumption of items can now be disabled
    • You can add a new flag to each item, "consume", which is either true or false (default = true).
    • Code (YAML):
       infinite-cookie:
          name
      : "&a&lMagic Cookie &7(Example Item)"
          item
      : COOKIE
          # You can prevent items from being taken away when clicked
          consume
      : false
          lore
      :
           - "&7Does not get consumed"
          commands
      :
           - "heal %player%"
       
  • Fix | General fixes to some bugs.
    • The plugin is now also open source :)

[​IMG]
----------, Aug 23, 2019

  • Data/durability can now be given in the config:
    Code (YAML):
     strength-sword:
        name
    : "&cInstant Strength"
        item
    : GOLD_SWORD:32
        lore
    :
         - "&7Gives you Strength 4"
        commands
    :
         - "effect %player% 5 15 3"
  • It can be also given under the key "durability" (your choice).
  • Data codes and durability are essentially the same thing in Bukkit, in this case the plugin will give you a Gold Sword with 32 durability (which means it will basically be destroyed with a single use, because durability works weird with Bukkit - durability 0 = full durability on the item).
----------, Oct 28, 2018

  • Removed blank line at bottom of items.
----------, Apr 28, 2018

Can now add enchantments to an item:

Code (Text):
  help-book:
    name: '&6Right click me for /help!'
    item: 'BOOK'
    enchantments:
      - 'ARROW_INFINITE:2'
    lore:
      - '&5&oGrants you permission for /help'
    commands:
      - 'pex user %player% add minecraft.command.help'
      - 'manuaddp %player% minecraft.command.help'
----------, Apr 30, 2016

Use
Code (Text):
executeas:player
at the start of the command to make the player execute the command
----------, Apr 28, 2016

Resource Information
Author:
----------
Total Downloads: 15,424
First Release: Mar 12, 2016
Last Update: Aug 9, 2021
Category: ---------------
All-Time Rating:
34 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings