ItemCommand - Add functions to items !
1.5.5Add commands, effects, broadcast, server-change & much more to items !
What's that ?
ItemCommand is a plugin that allows you to add various functions to items, it can be used for gameplay features, or as simple objects to provide an additional experience.
Features
- Allows to do multiple things with the item, not only use a single command
- Support for BungeeCord (Server connection, broadcast)
- In-Game creation support
- Block the sell of the items (Configurable)
- Smooth interface, easy to use commands
- Language change support (see lang.yml)
- Easy-to-use configuration
- Configurable admin-permission
Functions supported
In-game interface
In order to work, you need an item with a custom displayname and a custom lore, and then, you'll just have to do /ic createhand <name>. You'll be guided trough this interface in your hotbar, and you'll just have to write the function that you want inside you chat.
You can add up to 6 functions directly in-game, but it is unlimited if you edit this in the config later.
Sell protection
If you don't want your players to sell the items that they got, you just have to put the sell command(s) inside the config.yml, and do a /ic sellable <name> false, they won't be able to perform the command anymore when they have the item in hand.
Configuration
config.yml
By default, there's an item called test-item inside the configuration file.
# #------------------------------
# Configuration informations
# ------------------------------
# admin-permission » Gives access to /ic
# sell-commands » Commands that are blocked when the flag "sellable" is set to false in an ItemCommand, please include the slash
#
# ItemCommands syntax:item: item: <The Material you want to use, do not use Command Blocks>
# sellable: <true/false>
# display-name: <Display name of the item you want to use, you can use & or §>
# lore:
# - <The lore of the item you want to use>
# commands:
# - <Commands that'll be executed upon use>
# - <msg>Test » Will send a message to the player
# - <teleport>world;0;0;0 » Will teleport the player to given location
# - <effect>INVISIBILITY;255;0 » Will set the player invisible 1 for 255 seconds
# - <playercmd>home bed » Will force the player to execute a command
# - <broadcast>message » Will broadcast a message to the entiere server
# - <connect>hub » Will connect the player to given server
# - give %player% paper 1 » Will give an item to player
admin-permission: hadaria.admin
sell-commands:
- /hdv
- /sell
- /ah
- /auction
- /ya
items:
test-item:
item: PAPER
sellable: true
display-name: '&6Chèque &7(50$)'
lore:
- '&7&oCliquez sur ce chèque pour'
- recevoir 50$ !
commands:
- eco give %player% 50lang.yml
English
prefix: '&9ItemCommand &f&l»'
hover:
help: '&eHelp'
hover-mouse: '&7&oHover the commands to see help!'
ic-give: '&fThis command allows you to give an ItemCommand to a player'
ic-sellable: '&fThis command allows you to set the sellable status of an ItemCommand'
ic-createhand: '&fThis command allows you to create a new ItemCommand with the item in hand'
ic-remove: '&fThis command allows you to delete an ItemCommand'
ic-listitems: '&fThis command sends you the list of ItemCommands'
ic-reload: '&fThis commands allows you to reload the configuration file'
other:
item-list: '&eItemCommand list: &7'
config-reloaded: '&aConfig reloaded!'
unable-to-sell: '&eYou can''t sell this item!'
player-not-online: '&ePlayer &a%player% is not online!'
item-creation:
already-exists: '&cThis ItemCommand already exists!'
item-created: '&aThe ItemCommand &e%item% &ahas been created!'
need-lore-and-displayname: '&eItem must have a display-name and a lore!'
item-deleted: '&cThe ItemCommand &e%item% &chas been deleted!'
item-does-not-exist: '&cThe item &e%item% &cdoes not exists !'
now-sellable: '&eThe ItemCommand %item% is now &asellable'
no-longer-sellable: '&eThe ItemCommand %item% is &cno longer sellable'
action-cancelled: '&cAction cancelled'
enter-true-or-false: '&ePlease enter true or false'
added-command: '&aCommand added: &e%cmd%'
must-be-on-commandblock: '&cYou must have a command block in hand to write the command'
help-creating:
- '&eStarting editing of &a%item%'
- '&eTo cancel, type &a!cancel'
- '&eTo add a command, &atype it in the chat'
- '&eTo send a message, &atype <msg>Message'
- '&eTo teleport the player, &atype <teleport>world;x;y;z'
- '&eTo add a potion effect to the player, &atype <effect>effect;duration;amplifier'
- '&eTo force the player to run a command, &atype <playercmd>command'
- '&eTo broadcast a message, &atype <broadcast>message'
- '&eTo connect the player to a server, &atype <connect>server'
- '&eTo broadcast a message in the network, &atype <bungeebroadcast>message'
- '&eTo set the player''s health, &atype <health>9.5'
- '&eTo set the player''s food level, &atype <food>20'
- '&eYou can use the player''s name with &a%player%'
- '&eTo terminate, type &a/ic createhand %item%'
give:
inventory-is-full: '&ePlayer %player% inventory is full!'
given: '&eItemCommand &a%item% &ehas been given to &a%player% &ex%amount%'French
prefix: '&9ItemCommand &f&l»'
hover:
help: '&eAide'
hover-mouse: '&7&oPasse ta souris au dessus des commandes pour avoir de l''aide !'
ic-give: '&fCette commande permet de give un ItemCommand à un joueur'
ic-sellable: '&fCette commande permet d''activer ou de désactiver la vente d''un ItemCommand'
ic-createhand: '&fCette commande permet de créer un ItemCommand avec l''objet tenu en main'
ic-remove: '&fCette commande permet de supprimer un ItemCommand'
ic-listitems: '&fCette commande permet de voir la liste des ItemCommand'
ic-reload: '&fCette commande permet de recharger la configuration'
other:
item-list: '&eListe des ItemCommand: &7'
config-reloaded: '&aConfiguration rechargée !'
unable-to-sell: '&eImpossible de vendre cet objet'
player-not-online: '&cLe joueur &e%player% &cest hors-ligne'
item-creation:
already-exists: '&cCet ItemCommand existe déjà !'
item-created: '&eL''ItemCommand &a%item% &ea été crée !'
need-lore-and-displayname: '&cL''item doit avoir un nom et une description !'
item-deleted: '&cL''ItemCommand &e%item% &ca été supprimé !'
item-does-not-exist: '&cL''ItemCommand &e%item% &cn''existe pas !'
now-sellable: '&eL''ItemCommand &a%item% &eest désormais &avendable'
no-longer-sellable: '&eL''ItemCommand &a%item% &en''est &cplus vendable'
action-cancelled: '&cAction annulée'
enter-true-or-false: '&eMerci d''entrer &atrue&e/&cfalse'
added-command: '&aCommande ajoutée: &e%cmd%'
must-be-on-commandblock: '&cVous devez avoir un command block dans la main pour écrire une commande'
help-creating:
- '&eÉdition de &a%item%'
- '&ePour annuler, tapez &a!cancel'
- '&ePour ajouter une commande, &atapez la dans le tchat, sans slash'
- '&ePour envoyer un message au joueur, &atapez <msg>Message'
- '&ePour téléporter le joueur, &atapez <teleport>world;x;y;z'
- '&ePour ajouter un effet au joueur, &atapez <effect>effect;duration;amplifier'
- '&ePour forcer un joueur à executer une commande, &atapez <playercmd>command'
- '&ePour faire une annonce, &atapez <broadcast>message'
- '&ePour connecter un joueur à un serveur, &atapez <connect>server'
- '&ePour faire une annonce BungeeCord, &atapez <bungeebroadcast>message'
- '&ePour changer la vie du joueur, &atapez <health>9.5'
- '&ePour changer la nourriture du joueur, &atapez <food>20'
- '&eVous pouvez utiliser le pseudo du joueur avec &a%player%'
- '&ePour enregistrer, tapez &a/ic createhand %item%'
give:
inventory-is-full: '&e%player% a l''inventaire plein !'
given: '&a%item% &ea été donné a &a%player% &7(&ex%amount%&7)'
Developper API
@EventHandler
public void onIC(ItemCommandUsedEvent e) {
ItemCommand ic = e.getItemCommand();
Player p = e.getPlayer();
//Do what you want here
}
ItemCommandManager icm = new ItemCommandManager();
//Create an ItemCommand, will return false if it already exists
//Set the durability (data) to 0 if you don't want one, and set the skull_owner to null if it isn't neccessary
icm.createItemCommand(String name, Material m, String display_name, List<String> lore, List<String> commands, boolean sellable, int durability, String skull_owner)
//Delete an ItemCommand, will return false if it doesn't exists
icm.removeItemCommand(String name)
//Set the sellable status of an ItemCommand, will return false if it doesn't exists
icm.setSellable(String name, boolean sellable)
If you want to pay me a coffee, then visit https://paypal.me/dbzjp :)
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta