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.
@BaranCODE
i may have found whats going on. if i change the config to execute as console then it will allow the use of an item anyway.
one quick suggestion i think would be nice to add, is different options for commands to be executed. for example running the first command as OP and the second command as a player
i can sort of do this now by setting the config to run as console and then having the console run sudo commands. ive been making a couple items that add perms-"then"-run cmds(sudo to player)-"then"-remove perms to make sure they can only be executed with the item. this could be simplified by a "run-as-op" option.
<<reply 2099594>
kool kool, it works properly if i test the plugin on its own with no others.
Im in the process of elimination to see which of my own plugins may be causing the issue.
@ThaRam
Okay. When I changed the permissions system for the plugin, I hadn't really tested it, so there I knew some problems like that could occur. I'll fix them.
myitems.use.<item> is not restricted by default for my standard users/nonops.
im using essentials group manager and even if i try to specifically add - -myitmes.use.* to the default group people are still able to use the made itmes
also even removing group-manager dosnt change the issue
@Theminecraftiano
I tested it, and you're right, it did have some problems. It was a bug in the code. I've fixed it and uploaded the new version (1.7), which is waiting to be approved right now.
@BaranCODE
Yes sorry i didn't read everything... Also damageentityevent doesnt appear to be working :P any help?
@Theminecraftiano
Well, you already can use the name of the player in a command, with <user>. And for the second part, I might think about adding that.
@awsumkid56
You are probably typing something incorrectly.
Hello! I was wondering if you could add a couple of features that would be REALLY neat... first of all could you make so like when a player uses an item it can recognize the player E.G rightclickevent effect <name> regeneration 30 1 or something like that Second of all... Could you make so you can hide the command output? Let's take the first example... let's say that i'd like to hide somehow the message: Effect Regeneration given to player or whatever the command output is :p This way you could make some really neat user friendly mechanichs :p Thanks :D
now wen I try to /mi setcommand wandoffire rightclickairevent fireball its say that is not a valid event
ok thx
@awsumkid56
You need to do "/mi setcommand Firerod rightclickairevent fireball", not /fireball. Because when you type /fireball instead of fireball inside the setcommand, when you're executing the command, it does fireball. I'll edit the page to make that more clear.
I do /mi create Firerod Firerod 369[=blazerod I don't type this normaly just to tell you what item] then press enter then says item created then I do mi setcommand Firerod rightclickairevent /fireball then press enter then when I right click it says /help for list of commands even though /fireball is on the list of /help
@awsumkid56
No that's not what I meant. Can you post the exact commands you used while creating the item with MyItems, such as: /mi create someitem SomeItem 1, /mi set command... etc. The exact same way you used them.
/gamemode 1, /fly /fireball /give /say and other simple commands
@awsumkid56
Could you please give more details, such as the commands you are using to create and set-up your item.
@ThaRam
Oh I see what you mean. Currently, the plugin can't do that, but I'll add it.
When I make a item do a command no matter what command it says type "/help" for a list of commands. so then I am like oh maybe only vanilla commands work but then it still said type "/help" for a list of commands. so its ether a glitch or something of I doing something wrong. Please Help!
is there a way to disable an items normal action? say i wanted to put a command on a player head or something placeable and the command be activated by right clicking a block. im wanting only the set command to be executed and not the head or block to be placed also.
or keep player from trying to eat food when using a command on bread or something.
@BaranCODE
Thanks BaranCODE!