Hey everyone this is just a very small plugin request.. just something very simple... I was going to make a server using this: http://dev.bukkit.org/server-mods/itemrenamer/ And this: http://dev.bukkit.org/server-mods/epicboss/files/33-epic-boss-2-3-9/ is there a way i could have players craft items.. but with custom item names so for example craft a diamond block with 5 dirt. But then get a blue dirt rock item. And not diamond. I don't mind if you could for example craft the blue rock back in to 9 diamonds. What i'm going for here is that players can craft custom named items. and use it to execute a command. In this case: a boss. is it possible to do it? Does it already exist? I couldn't find it tough...
Its not custom items... its renamed items. You can do that on any vanilla server with an object called anvil.
I'll give it a go now! I'm up for a fun challenge It's not very simple but I'm still trying >.< Masterflapdrol http://dev.bukkit.org/server-mods/itemrenamer/ Does this do what you want? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
I even linked it in the post. maybe i'm not clear enough.. i want players on my server to craft custom named items. for example the blue rock, diamond block. use it (right or left click) to execute a command. it only works with that item. so you can't execute it with a normal diamond block. thats all Edit: i don't know anything about coding. The idea seemed simple to me. maybe its bedrock hard to code.. :/ i don't know. i've had soo many more requests and people ditnt make it not because it wasn't possible. but because it was really big and tuff to make
Well you'd need to set up a listener for CraftItemEvent Code:java @EventHandler(priority = EventPriority.NORMAL)public void onCraftItemEvent(CraftItemEvent event) { ItemStack selectedStack = event.getInventory().getResult();int selectedStackTypeId = selectedStack.getTypeId();short selectedStackDamageValue = selectedStack.getDurability(); // re-name the item stack here } I can't find anything in the Bukkit API to do the renaming at the moment, and I don't want to mess around with vanilla minecraft code since updates will probably break it. A problem I encountered was if you click the slot where the crafted item should be but the slot is empty when you click it, it throws severe errors to the console a/o server log
I believe ItemMeta has a setName method. I can look into it further if you want. You shouldn't need to use nms code
I'm pretty sure this is possible by attaching xyz MetaData to a diamond block but I'm too busy to look into it, sorry.
You don't have to mess around with nbt tags and metadata. Bukkit has a class called itemmeta that handles it for you. Now, I just need to check the display name of a crafted object, and if it is a certain value, execute the command specified in the lore. Is that good Masterflapdrol?
Exactly! Perfect! thank you! But I don't have any coding program of some sort. But its very interesting to look at your codes... maybe a config would be great! (edit: would the command then be executed by normal diamond blocks as well? That could be a problem) oh and the command isn't used on the craft event. but on the player interaction. after that the item is taken away