OneTimeUse | Use an item once and execute a command

MC Plugin OneTimeUse | Use an item once and execute a command 2.4.1
Give players an One Time Use item which executes a command when right clicking

[IMG]

[IMG]

OneTimeUse is a plugin that lets you use an item just once and executes a command or multiple commands you can set in the config. So you can give a player an item that heals the player, after he right clicks it the player will be healed and the item will be removed from the inventory. You can also configure it when the player clicks with an otu item on another player, the player that was clicked on will execute the commands.
[IMG]

- You can use every item as a OneTimeUse item
- You can create a kit with multiple OneTimeUse items in it
- You can add as many commands as you want to one item
- One item can execute a whole list of commands or a random command
- Unlimited items can be added in the config
- Option to allow the players to drop the item or not
- Option to allow the players to craft with the item or not
- Play a sound when using an OTU item
- Create particles when using an OTU item
- Color codes support
- Every message is customizable
- Every item ID is customizable
- Every item name is customizable
- Every item lore is customizable + multiple lores supported
- Automatic checking for updates, can be disabled in the config
- Each OTU item has its own permission
- Supports PlaceHolderAPI
- And more
[IMG]

You can use /onetimeuse and /otu

/otu help : No Permission
/otu list: otu.list
/otu giveall <item> <amount> : otu.giveall
/otu give <player> <item> <amount> : otu.give
/otu kit <player> <kit> <amount>: otu.kit
/otu reload : otu.reload
permission to use the items: otu.use.* (permission to use every OTU item) or otu.use.itemname
(example: an item with the name fireball will have the permission node: otu.use.fireball)
To prevent someone from using a specific item: otu.deny.itemname
[IMG]

Code:
###############################
#   Plugin made by ParaStyle  #
#         Version 2.4.1       #
###############################

Config:
  CheckForUpdates: true
  PluginTag: "&f[&6OneTimeUse&f] "
  DisabledWorlds:
    - OTUDisabledWorld
    - OTUDisabledWorld_nether

Messages:
  NoPermissionGiveAll: "&4You have no permission for this command!"
  NoPermissionGive: "&4You have no permission for this command!"
  NoPermissionKit: "&4You have no permission for this command!"
  NoPermissionUse: "&4You have no permission to use this item!"
  NoPermissionList: "&4You have no permission to check the list!"
  NoPermissionReload: "&4You have no permission to reload the config file!"
  PlayerOffline: "&4This player is offline!"
  NoItem: "&4You have no item with that name!"
  NoKit: "&4You have no kit with that name!"
  OnlyUseNumbers: "&4Only use numbers for the amount!"
  NoDrop: "&4You can't drop this item!"
  WrongCommand: "&4For more help use /otu help"
  Help:
    - "&3-----Commands-----"
    - "&3/otu list : &fshows the list of items"
    - "&3/otu give <playername> <item> <amount> :&f gives the player the item"
    - "&3/otu reload :&f reloads the config file"
  GaveAll: "&2You gave %amount %item item to all online players."
  GaveItem: "&2You gave %amount %item item to %targetplayer."
  GaveKit: "&2You gave %amount %kit kit to %targetplayer."
  ReceivedItem: "&2You received %amount %item item from %player."
  ReceivedKit: "&2You received %amount %kit kit from %player."
  NoOffHand: "&4You are not allowed to use OneTimeUse items in your off hand."
  DisabledWorld: "&4You are not allowed to use OneTimeUse items in this world."
 
Items:
  TestItem1:                     
    MaterialName: REDSTONE_TORCH     #THE NAME OF THE MATERIAL, list at (dont use items starting with LEGACY): https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
    ItemName: "&6Test Item One"      #THE DISPLAY NAME OF THE ITEM
    ItemLore:                        #THE LORES OF THE ITEM
      - "&3Right Click"
      - "&3Second lore"
    ItemMessage: "&6TestItem1 has been used!"  #THIS MESSAGE WILL BE SENT TO THE PLAYER WHEN USING THE ITEM. REMOVE LINE TO SEND NOTHING.
    DropItem: false                  #CAN YOU DROP THE ITEM? true = drop , false = no drop
    CraftWithItem: false             #CAN YOU USE THE ITEM IN THE CRAFTING TABLE? true = yes, false = no
    Glowing: false                   #TRUE = GLOWING EFFECT
    ReceiveMessage: true             #DO YOU WANT THE PLAYERS TO GET THE "RECEIVEDITEM" MESSAGE WHEN RECEIVING THIS ITEM?
    ClickedPlayerExecute: false      #TRUE= THIS ITEM WILL ONLY WORK WHEN IT IS CLICKED ON ANOTHER PLAYER, THE CLICKED PLAYER WILL EXECUTE THE COMMANDS
    ConsoleCommands:                 #THE COMMANDS THAT WILL BE EXECUTED BY THE CONSOLE, YOU CAN ADD AS MANY AS YOU WANT
      - "time set day"
    RandomConsoleCommand: false      #Execute one random console command from the list above instead of executing the whole list
    PlayerCommands:                  #THE COMMANDS THAT WILL BE EXECUTED BY THE PLAYER, YOU CAN ADD AS MANY AS YOU WANT
      - "help"
    RandomPlayerCommand: false       #Execute one random player command from the list above instead of executing the whole list
    PlayerAsOpCommands:              #THE COMMANDS THAT WILL BE EXECUTED BY THE PLAYER AS OP, YOU CAN ADD AS MANY AS YOU WANT
      - "gamemode 1"
    RandomPlayerAsOPCommand: false   #Execute one random player as op command from the list above instead of executing the whole list
    Particle: EXPLOSION_NORMAL       #What particle should be created when using the OTU item? To create no particle, remove this line. This is a spigot version 1.10+ particle, so this particle won't work on spigot versions below 1.10. Particles list: https://www.spigotmc.org/wiki/cc-particles-list/
    Sound: BLOCK_ANVIL_BREAK         #What sound should be played when using the OTU item? To play no sounds, remove this line. This is a spigot version 1.9+ sound, so this sound won't work on spigot versions below 1.9. Sound list: https://www.spigotmc.org/wiki/cc-sounds-list/
    ReceiveOnFirstJoin: 3            #When joining the server for the first time, the players will receive testitem1 3 times.
    CommandDelay: 2                  #The delay of executing the commands (in seconds)
  TestItem2:
    MaterialName: PLAYER_HEAD
    #Use PlayerHeadName if you want so set the skull to the textures of a player
#   PlayerHeadName: "Notch"
    #Use PlayerHeadTexture if you want to set the skull to a custom texture value
    PlayerHeadTexture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDhlYmQ4Yzc4NTg1NzViYzlhOTIwN2FkZTRlYWMxZGIwNGQ2OWI5MDllMzYwMGE3MDBkYTZhNzZhM2Q5ZmYyZSJ9fX0="
    ItemData: 0
    ItemName: "&6Test Item Two"
    ItemLore:
      - "&7Right Click"
      - "&2Second lore"
    ItemMessage: "&6TestItem2 has been used!"
    DropItem: false
    CraftWithItem: true
    Glowing: true
    ReceiveMessage: true
    ClickedPlayerExecute: false
    ConsoleCommands:
      - "eco give %player 100; broadcast %player received $100" #When using random commands you can execute multiple commands by using this format: "command1; command2; command3; ..."
      - "eco give %player 200; broadcast %player received $200" #This will execute "eco give %player 200" and "broadcast %player received $200"
      - "eco give %player 300; broadcast %player received $300"
      - "eco give %player 400; broadcast %player received $400"
    RandomConsoleCommand: true
    RandomConsoleCommandChance:      #Set the chances for the commands that can be randomly executed (in %, make sure the total is 100%)
      - "10"                         #10% chance for - "broadcast random"
      - "10"                         #10% chance for - "broadcast console"
      - "10"                         #10% chance for - "broadcast command"
      - "70"                         #70% chance for - "broadcast executed" (10% + 10% + 10% + 70% = 100%)
    PlayerCommands:
      - "heal"
      - "money"
    RandomPlayerCommand: true
    RandomPlayerCommandChance:
      - "20"
      - "80"
    PlayerAsOpCommands:
      - "gamemode 0 %player"
      - "fireball"
      - "gamemode 1 %player"
    RandomPlayerAsOPCommand: true
    RandomPlayerAsOPCommandChance:
      - "75"
      - "10"
      - "15"
    Particle: FIREWORKS_SPARK
    Sound: BLOCK_ENDERCHEST_OPEN
    ReceiveOnFirstJoin: 0
    CommandDelay: 0

Kits:
  StarterKit:                   
    TestItem1: 3                     #itemname (an OTU item you made in the 'Items' section above): amount
    TestItem2: 5                     #This kit will give 3 times testitem1 and 5 times testitem2
    ReceiveMessage: true
    ReceiveOnFirstJoin: 1
MESSAGES PLACEHOLDERS:
%amount: The amount of items you have given to the player
%item: The item you have given to the player
%kit: The kit you have given to the player
%targetplayer: The player you have given the item
%player: The player who executes: /otu give
PlaceHolderAPI placeholders
COMMANDS PLACEHOLDERS:
%player to get the player who clicked the item
%location to get the location of the player who clicked the item
if you have idea's for more placeholders, let me know!
FateKid
Author FateKid
Level
11
5,910 pts
2.4.1 Version
3 Downloads
144 Views
Published
Updated
0.00 star(s) 0 ratings Average Rating (0)

More files from FateKid

Minecraft Is Better With Plugins

OneTimeUse | Use an item once and execute a command is the ultimate Minecraft plugin to take your next project to new heights. Increase the quality of your Minecraft server gameplay by downloading it for free!

Why Choose our Minecraft Plugins?

  • High-quality uploads for an enhanced user-experience.
  • Enhanced gameplay features for more fun and excitement.
  • Regular updates and new plugins to keep things fresh.

Explore Other Resources

Are you looking for something different? Explore thousands of other plugins, available to download right now. FateKid shared this wonderful resource to you for free, so remember to share your appreciation by liking the resource and reviewing it.

Get started today and make your Minecraft world truly unique.

Top Bottom