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.
@samueli5750
Okay, so MyItems is not compatible with MyCommands. I believe the same thing is true with Booscooldowns. However, I am planning to work on that. I will either make them compatible, or, add features like economy into MyItems so that you won't have to do it with Booscooldowns.
@stengun
Okay, I'll work on fixing those.
Edit: I have finished it, and uploaded the plugin. It is waiting to be approved right now. It will be version 1.6
Hi!
I think I have found a possibly unwanted behavior. If you create multiple copies of an item and you manage to stack them into a single slot, when you activate the handheld item the entire stack disappears (if the item is a single use one) instead of consuming only one.
Can you please fix that and also allow players to use /mi get even if the item is already present into their inventory?
Thanks in advance, good work with this plugin.
@BaranCODE
You are full of heart. Thank you for your help. Moreover, i set command cost when the player use /lock with $100 ( http://dev.bukkit.org/bukkit-plugins/booscooldowns/ ) but if via Myitems to execute the command then it won't deduct ther money $100... is it bypass all plugin setting? i only set console = false
@samueli5750
I'll test it and let you know.
@BaranCODE
Dear BaranCODE,
May i know that MyItems is it support the this plugin (http://dev.bukkit.org/bukkit-plugins/mycommand/) custom command? I tired but failed. MyItems seem can't detect the custom command
@broluigi
I'll think about adding it.
@BaranCODE
How about this! Can it be made that specific mobs can have certain percentage to drop a myitem?
@broluigi
Once again, if you had read the page, you would have known that you can split commands using " && " (without quotes). So you could do this, for instance:
/mi setcommand someitemname leftclickevent list && me did /list and died && kill
If you're editing from the item's file, in the MyItems folder, you can also do the same thing to split commands.
@BaranCODE
can i have multiple commands go on in a single item?
@broluigi
First do:
/mi create <name> <display name> <item ID>
to create the item itself. You can set a lore with:
/mi setlore <name> <lore>
Then, when you're setting the command, you need to choose an event (when that command will be executed). You may want to do something like this:
The MyItems plugin will automatically replace <user> with the name of the player that used the item. If you had read everything on this page, you would have known that.
By default, it will make it as if the player wrote the command. If you want to make it seem like the console wrote it, set console-executor to true inside the config.
@BaranCODE
i need a item to be able to do /sleepyfeeling add <playername> 3000 where it says playername, it needs to automatically figure out who is holding it and put the name there before executing the command. How can i make a item like that?
@KoroEDM
Okay, I'll add a feature like that.
@BaranCODE
Certain player based commands cannot be execute through the console. So yes I mean that if they cannot normally use the command, but they use it through the item it would work. I've seen other plugins that just add the node '*' to the player for the split second it takes them to use the item for this to work, if that helps you at all.
@AirstarAirliners
When you do /mi get, it creates a custom item that can only be accessed by this plugin, and gives it to the player. Essentials kits, as far as I know, only supports normal minecraft items. That's why, I believe, the only way that you can use a MyItems item in a kit is by making the item global with the -g flag. I'll see if I can come up with a better solution.
Edit: I think I have found a solution. I'll test it, and tell you if it works.
Is there a way to give users these items through Essentials Kits? If not, I think this would be a great feature.
@KoroEDM
Do you mean, if the player normally can't do a command, but if he does it through an item, it will allow him? If so, you can just set the command executor to be the console, from the config, so permissions won't be a problem, and you can use the user's name in the command with <user> (wait for the 1.5 MyItems update, if you're going to do that, because 1.4 is buggy about that).
Cool plugin. You should add something that allows the person activating the item a temporary permission bypass and I would definitely use this.
@GPSforLEGENDS
Oh I get why this is happening. Thanks for bringing it to my attention, I'll fix it.
Edit: I fixed it and added it to the newest update (version 1.5). It is waiting to be approved right now.
@PhillyCheezsteak
Oh I think I know what the problem is. Its a bug in the code, I'll fix it quickly.
Edit: I have uploaded version 1.5, which should fix your problem. It is waiting to be approved right now. Tell me if your problem still occurs after that version.