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.
Hi, I really like this plugin, but I get a continuous error on my server that causes lag and slowly crashes it. I am 100% it is the plugin since it only happens when I have the plugin on. Here it is.
13:37:44 [SEVERE] Could not pass event EntityDamageByEntityEvent to MyItems v1.4
org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja va:437) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav a:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredLi stener.java:31) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j ava:479) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j ava:464) at org.bukkit.craftbukkit.v1_6_R3.event.CraftEventFactory.callEvent(Craf tEventFactory.java:80) at org.bukkit.craftbukkit.v1_6_R3.event.CraftEventFactory.callEntityDama geEvent(CraftEventFactory.java:423) at org.bukkit.craftbukkit.v1_6_R3.event.CraftEventFactory.handleEntityDa mageEvent(CraftEventFactory.java:452) at net.minecraft.entity.EntityLivingBase.func_70097_a(EntityLivingBase.j ava:967) at net.minecraft.entity.passive.EntityAnimal.func_70097_a(EntityAnimal.j ava:206) at pixelmon.entities.pixelmon.Entity3HasStats.func_70097_a(Entity3HasSta ts.java:169) at pixelmon.entities.pixelmon.Entity4Textures.func_70097_a(Entity4Textur es.java:45) at pixelmon.entities.pixelmon.Entity6CanBattle.func_70097_a(Entity6CanBa ttle.java:132) at pixelmon.entities.pixelmon.Entity7HasAI.doBattleDamage(Entity7HasAI.j ava:165) at pixelmon.battles.attacks.Attack.use(Attack.java:224) at pixelmon.battles.controller.BattleController.takeTurn(BattleControlle r.java:308) at pixelmon.battles.controller.BattleController.update(BattleController. java:157) at pixelmon.battles.BattleRegistry.updateBattles(BattleRegistry.java:62)
at pixelmon.battles.BattleTickHandler.tickStart(BattleTickHandler.java:1 2) at cpw.mods.fml.common.SingleIntervalHandler.tickStart(SingleIntervalHan dler.java:28) at cpw.mods.fml.common.FMLCommonHandler.tickStart(FMLCommonHandler.java: 122) at cpw.mods.fml.common.FMLCommonHandler.onPreWorldTick(FMLCommonHandler. java:295) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.jav a:867) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(Dedicated Server.java:330) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.jav a:777) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:659) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer. java:16) Caused by: java.lang.ClassCastException: za.co.mcportcentral.entity.CraftCustomT ameableAnimal cannot be cast to org.bukkit.entity.Player at com.barancode.mc.myitems.Main.damageEvent(Main.java:599) at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja va:435) ... 26 more
If you know how to fix this, please reply
@BaranCODE
no they console will give stone to the console
@GPSforLEGENDS
I don't understand what you're saying. The console is the executor, and the command is EXACTLY "/give <user> stone 1" right? If that's the case, it should work. The plugin itself will replace the word <user> with the name of the player that used the item.
@GPSforLEGENDS
ok it still not works what i want. a give you an better example.
i want to use with the item /give <user> stone 1
without he got the permissions but if the console is the executor it doesnt work because the console is the sender and the player doesnt get his items
@BaranCODE
ok thanks
@GPSforLEGENDS
You could just set the command executor to be the console, in the config. That will make it as if the console wrote the commands.
you should add that you cam also execute the command on the item even if you dont have the permissions. For example you dont have the permissions for /rain but if you use the item you can use it
@BaranCODE
your the man. Also you should think about adding delayed commands i would love for my players to be able to fly for 30 seconds and then have it shut off fly for them :D
@togie14
Okay, I may do something like that.
idea. instead of having who commits the command in the config make it per item commanduser: [user],[superuser],[console]
on better note make it per command ... say i have 2 commands
fly
jump - world edit
fly i can use through the console but jump i cannot
leftclickairevent: [superuser]jump
rightclickairevent: [console]fly <user>&&[user]me Feels as light as a feather
and set default to user so:
rightclickairevent: fly
would be entered as user
@rnedevil001
Do you think its possible/already here for: -when a player is hit by, say a snow ball or special arrow, it gives that player X amount of currency. -Clicking an item in your inventory, or backpack, having it execute a command such as warping.
@TheRam
If the entity that was clicked is a player, you can use the player's name with <clicked>. However, if it isn't a player, it will not work. In the next update, I will make it so that if a mob is clicked, it will insert the mob's type for <clicked>.
I have added this in v1.4. It is waiting to be approved.
is there a variable that can represent the entity that was clicked with rightclickentityevent?
say i wanted the command to be" /say me poked it", where "me" is the variable representing the player using the item, and "it" represents the entity that was clicked
@Chuckchuk
That's a good idea, I'll add that.
@tdbulldog
1. This plugin itself can't execute two commands in one event, although you can put them in different events. I'll add this later. For now, you can use an alias plugin such as BetterAlias to make an alias for two commands, and then use the alias with this command. 2. Features: - They can execute commands as the player that used it or as the console (change from the config file)
Please read the page more carefully.
@Dessiph
You can do that from inside the file of that item, in plugins/MyItems/<name>.txt
Does it support crafting recipes? That would be very useful, I have races on my server, and it would be great if every race could have a custom craftable food, that has different attributes, and maybe it could only be crafted by having a permission, like the elves can make a very special stew, for example, that they can only craft, and that gives you regeneration maybe... It would be great to have custom crafting recipes.
Does this support multiple commands? Like /playsound and /effect. Also, can we make the commands run from console?
I have a question @BaranCODE
How can I made a DisplayName with Spaces between the words?