OneTimeUse Use an item one time and execute a command

ULTRA OneTimeUse Use an item one time and execute a command 2.4.1 (1.8-1.12)

Tested Minecraft Versions:
  • 1.8
  • 1.9
  • 1.10
  • 1.11
  • 1.12


OneTimeUse is a plugin that let 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.

- You can use every item as a OneTimeUse item
- 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 customisable
- Every item ID is customisable
- Every item name is customisable
- Every item lore is customisable + multiple lores supported
- Automatic checking for updates, can be disabled in config
- Each OTU item has its own permission
- And more

You can use /onetimeuse and /otu
/otu help : No Permission
/otu list: otu.list
/otu give <player> <item> <amount> : otu.give
/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)

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

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

Messages:
  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 gave 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"
  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:                         #DONT USE CAPTALS ONLY LOWERCASE!
   ItemID: 76                       #THE ID OF THE ITEM
   ItemData: 0                      #THE DATE OF THE ITEM (EXAMPLE: Polished Granite id = 1:2 -> 1 is the ID, 2 is the data type)
   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
     - "heal"
   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.
  testitem2:
   ItemID: 17
   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: True
   ConsoleCommands:
     - "broadcast random"
     - "broadcast console"
     - "broadcast command"
     - "broadcast executed"
   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"
     - "help"
     - "money"
   RandomPlayerCommand: True
   RandomPlayerCommandChance:
     - "25"
     - "10"
     - "65"
   PlayerAsOpCommands:
     - "gamemode 0 %player"
     - "fireball"
     - "gamemode 1 %player"
   RandomPlayerAsOPCommand: True
   RandomPlayerAsOPCommandChance:
     - "75"
     - "10"
     - "15"
   Particle: FIREWORKS_SPARK
   Sound: BLOCK_ENDERCHEST_OPEN
   ReceiveOnFirstJoin: 0

Kits:
  starterkit:                        #DONT USE CAPTALS ONLY LOWERCASE!
   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

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!





Stop you server.
Drop OneTimeUse.jar in the plugins folder.
Start your server.
Enjoy!

By purchasing this plugin you agree to the terms and conditions.
You are not allowed to redistribute this plugin
You are not allowed to decompile this plugin
Only use it for your server/network
No refunds

If you like this plugin please leave a review.
If you find any bugs or have a suggestion for this plugin please contact me or post them in the discussion section.
Author
Wifi
Downloads
0
Views
16
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Wifi

Top