MyItems
This plugin allows you to create custom items, with custom names and lores, which can execute commands on different events.
Features:
- Create items with custom names and lores (color codes supported)
- These items can execute commands on different events
- They can execute commands as the player that used it or as the console (change from the config file)
- Use the name of the player that uses the item inside the command (with <user>)
- Use the name of the player or mob that got clicked on (only for rightclickentityevent or damageentityevent) inside the command (with <clicked>)
- Use multiple-lined lores using "&&" (without quotes) for a new line
- Create global items (see "What are global items?" below)
- Create single-use items
- Use data values for items
- Execute multiple commands on one event using " && " (without quotes) to split them
Please read the Features list, carefully, as it contains details about what the plugin can do, and how to use those. If you have a question, it's likely that the answer might be there (or somewhere else on this page).
Permissions:
By default, only OPs have these permissions.
- myitems.create
- myitems.setlore
- myitems.setcommand
- myitems.get
- myitems.use.<ItemName>
- myitems.list
- myitems.delete
Commands:
- /mi - Help page
- /mi get <name> [playername] - Get an item
- /mi list - List the items
- /mi create <name> <display name> <item ID> [-g] [-s] - Create a new item. If you use the -g flag, the item becomes global. If you use the -s flag, it becomes a single-use item
- /mi setlore <name> <lore> - Set the lore of an item
- /mi setcommand <name> <event> <command> - Set the command to be executed on certain events (see below) for an item
- /mi delete <name> - Delete an item
Events:
- leftclickevent (Event Group)
- damageentityevent - When you hit another player or a mob
- leftclickblockevent - When you left-click a block
- leftclickairevent - When you left-click in the air
- rightclickevent (Event Group)
- rightclickentityevent - When you right-click another player or a mob
- rightclickblockevent - When you right-click a block
- rightclickairevent - When you right-click in the air
- consumeevent - When you eat the item (only for food)
- blockplaceevent - When you place a block
- holdevent - When you first hold the item
- throwevent - When you throw the item (only for throwable items such as snowballs)
- bedenterevent - When you enter a bed
More events will be added later (give me some ideas).
What are global items?
Let's say you create an item (using "/mi create") that's not global, and set the commands for it. If this item has the ID of a dirt block, it won't change the behavior of a normal dirt block. Normal dirt blocks won't execute commands, but the dirt block you get with "/mi get" will.
Now, if that's how non-global items are, you can probably guess what global items are. You create an item (using "/mi create") which is global, and set the commands for it. It has the ID of a dirt block. The dirt block you get with "/mi get" will execute commands, however, every other dirt block in minecraft will also be able to execute the same commands.
Bugs/Problems:
If you find one, submit a ticket.
Upcoming Features:
- itembreakevent
- Enchanted items
- Craftable items
- Permissions override with items (execute as OP)
- Make a flag that allows to cancel the event
- Configurable no permission message
- Allow stopping the normal behavior of items in a MyItems event
If you want a feature added, submit a ticket.
Note: If you have a question, read everything again, very carefully, to make sure your question isn't something that was answered here. If you still can't figure it out, post it in the comments.
I am making a new version, which will have several new events (including rightclickairevent), and also event groups. For example, the rightclickevent group will include rightclickairevent, rightclickblockevent, and rightclickentityevent.
@peace1498 If you had read everything on this page, you would have known that you can use <user> inside the command to get the players name.
@BaranCODE
Um Baran, i probably should of told you this before but "/effect" requires the players name and wont except @a, @p etc. I tried it before on "rightclickblockevent"
Ok guys, I have uploaded the update! Waiting for it to be approved.
In this update, there is support for data values, there is a flag in the create command that allows you to make single-use items, there is a new event (holdevent), and you can now give an item to another player with commands.
@peace1498
Ok, I'll do something like that.
UPDATE: I have added a "holdevent" event in v1.2. You can use that event, and make it so that it executes the command /effect.
Quick question, could you make a command for adding potion effects to an item. like when you hold it you get the effect?
@tdbulldog
Sorry. I'm aware that this update has taken quite long, but I've been very busy. I'll try to focus on it more the next few days. I can't give a certain day, because there's this bug that I'm having some troubles with, and I don't know when I will fix it, however it should be done by the weekend.
Should we expect an update before long? Cannot wait to use this!
@DewTheMelon
No, but I'll add it.
Does this support Enchantments too?
@tdbulldog
I've been very busy this week, but I'll try to release the update in a week or so.
When should we expect an update?
@tdbulldog
Ok, I'll be adding that into the plugin.
@BaranCODE
I would like a configuration so that when you "use" and item, it disappears. This would be a wonderful way for me to make "drugs" (you click a mushroom for example, and then the console runs an /effect command, and the drugs you "used" are removed from your inventory)
You could include a command in your plugin such as /removehand <player>. Whatever the <player> is holding in their hand is removed from their inventory, that away my Drug idea would keep the user from using the same item to get "high" over and over again, instead they would need to find more "drugs"
@tdbulldog
It currently doesn't support data values, but I will be adding this in the next update.
The block isn't supposed to disappear.
Does this support data values?
When a user right clicks a pink dye, the dye disappears from their inventory and the command is applied,
So: 2 questions:
Will this command remove the item from the users inventory after a use? Does this plugin support data values, and only run the command on a certain block (Example, run on pink dye, but not lime dye)
@manos34
No, this does not affect normal minecraft items (in this case, diamonds). The plugin allows you to create custom items (like an item called AwesomeDiamond) which can execute commands. I might add what you said, in a future update, though.
Update: I have added this in the 1.1 version.
Is this a universal thing, say I got a diamond and the command was set to diamonds, then would I use it and the command will run?
@Alsiokowsky
I'm not sure I understand. Do you mean that the player will have to reach a certain level to gain access to an item? Also, please submit a ticket for this instead of posting it in the comments.