Item Renamer
Tired of blocks called Sand? Want your enderpearls to say Grenade instead? Want to add extra lines of text below item names? Do all that and more with ItemRenamer. You can create your own custom item names for all items in your server, but still let users rename with an anvil. You can create your very own language pack!
Installation
- Download ProtocolLib and put it in your plugins folder
- Place ItemRenamer.jar in your plugins folder, on server start the configuration will be generated
- Test out the example config by setting your world to run the example pack, to see how it works
- Go crazy and make your own language pack
Developer Build
Development builds of this project can be acquired at the provided continuous integration server.
These builds have not been approved by the BukkitDev staff. Use them at your own risk.
Jenkins server
For developers
ItemRenamer 2.0.0 contains a fully-fledged API. Click here for more information.
Configuration
Default configuration can be found here.
Config | Default | Ranges | Description |
---|---|---|---|
autoupdate | true | [true/false] | Will remind you when a new version is available |
creativedisable | true | [true/false] | Will disable ItemRenamer while you're in creative mode |
worlds.<worldname> | Pack name | Will set this world to run the pack you put here | |
packs.<packname>.<itemid>.<data>.name | Any string | Will rename itemid:data to your string | |
packs.<packname>.<itemid>.all.name | Any string | Will rename all itemid data values to your string | |
packs.<packname>.<itemid>.other.name | Any string | Will rename all unset itemid data values to your string | |
packs.<packname>.<itemid>.<data>.name | Any string | Will add your name to itemid:data | |
packs.<packname>.<itemid>.<data>.lore | Any string | Will add your lore list to itemid:data | |
packs.<packname>.<itemid>.<first>-<last>.name | Any string | Will add your name to every itemid with a data value of the give range. | |
packs.<packname>.<itemid>.<first>-<last>.lore | Any string | Will add your lore list to every itemid with a data value of the give range. | |
packs.<packname>.<itemid>.all.lore | Any string | Will add your lore list to all itemid data values | |
packs.<packname>.<itemid>.other.lore | Any string | Will add your lore list to all unset itemid data values |
- Note: place lore in [square brackets] OR on seperate lines starting with a dash -
Player-specific packs
If you want to customize the renamer pack for a specific group of players, regardless of world, you may use the player info itempack along with the desired renamer pack. This feature requires Vault and a permission/chat plugins that supports player info.
This can be done as follows with PermissionEx:
users: Player: group: - Members options: itempack: none
Usage
It's possible to configure ItemRenamer without ever having to touch the configuration file or deal with the more complicated (but powerful) commands. Simply select an item you want to rename, and type the following:
/renamer select hand
That will select your current item's ID and durability (except for armor and tools), along with any enchantments, potion/fireworks effect, etc. Then use set name and add lore to rename the item and every other like it on the server:
/renamer set name Nameless Tool /renamer add lore Unknown Artifact
This will automatically be applied to the current world you're in. Use "renamer set pack" to apply it to a different item pack, or teleport to the world with the item pack you want to rename.
Commands
- Change whether or not to automatically check for updates:
/renamer set setting autoupdate [true|false] - Get what item pack has been assigned to a particular world:
/renamer get world [world_name] - Assign an item pack to the given world:
/renamer set world [world_name] [pack_name] - Add a new item pack:
/renamer add pack [pack_name] - Delete an item pack:
/renamer delete pack [pack_name] - Select a item pack to use for all subsequent commands:
/renamer select pack [pack_name] - Rename all items similar to the one the player currently is holding:
/renamer select hand - Deselect the current item pack, going back to manually typing it:
/renamer select none - Get the rename rule for a particular item:
/renamer get item [pack_name] [itemID] [all|other|0-32767] - Set the name of an item(s) matching a single or multiple damage values:
/renamer set name [pack_name] [itemID] [all|other|0-32767] [0-32767] [name (with spaces)] - Add a new lore line to an item(s) matching a single or multiple damage values:
/renamer add lore [pack_name] [itemID] [all|other|0-32767] [0-32767] [lore (with spaces)] - Remove all the existing lores for a particular set of items:
/renamer delete lore [pack_name] [itemID] [all|other|0-32767] [0-32767] - Add a new enchantment to a set of items: /renamer add enchantment [pack_name] [itemID] [all|other|0-32767] [0-32767] [enchantment_name] [level]
- Remove an existing enchantment for a set of items: /renamer remove enchantment [pack_name] [itemID] [all|other|0-32767] [0-32767] [enchantment_name] [level]
- Reload configuration:
/renamer reload - Save configuration now instead of during server shutdown:
/renamer save
All commands default to OP, but also have permissions.
Modify enchantments
It is also possible to add or remove existing enchantments to any given item. The easiest method is to mark the item you want to modify in your hotbar, and type the following command:
/renamer select hand /renamer add enchantment NO_ATTRIBUTES 1
Every vanilla enchantment is supported:
- Bow: POWER, PUNCH, INFINITY, FLAME
- Weapon: SHARPNESS, BANE_OF_ARTHROPODS, SMITE, FIRE_ASPECT, KNOCKBACK, LOOTING, UNBREAKING
- Tool: FORTUNE, EFFICIENCY, UNBREAKING, SILK_TOUCH
- Armor: RESPIRATION, PROTECTION, BLAST_PROTECTION, FEATHER_FALLING, FIRE_PROTECTION, PROJECTILE_PROTECTION, THORNS, AQUA_AFFINITY
There's also three custom enchantments:
- GLOW 1: Preserve the enchantment glow with no visible enchantment name
- NO_ATTRIBUTES 1: Remove all the attribute lines introduced in 1.6.1 and 1.6.2.
- NO_DURABILITY 0: Remove any visible durability on the item. Switch out 0 with any other number to force a durability value.
Permissions
itemrenamer.config.get — read-only access to configs
itemrenamer.config.set — can edit configs or reload from disk
itemrenamer.update — gets a notification when update is ready, and can use update command
Notes
- Join us on irc at: irc://esper.net/ItemRenamer
- Items in the creative menu are only client-side, and thus cannot be renamed by this plugin. But creative players will see their items renamed in the main inventory bar.
- This plugin doesn't actually edit any items, they just appear renamed .. if you were to suddenly stop using this plugin all items should go back to normal
- If a player renames an item in an anvil, that name should take precedence over the ItemRenamer one
- When setting lore in game make sure to wrap the text in square brackets, each line separated by a comma, and enclosed in quotes if it contains special characters
Sourcecode
Access the source code via GitHub:
https://github.com/meiskam/ItemRenamer
I tried updating from version 1.6.2 of your plugin to version 2.0.1, but now I seem to be getting a strange glitch, somewhat akin to essentials' /unlimited command:
When I take renamed items from a stack and place them down into an inventory slot, the item, no matter what quantity, turns into a full stack of items.
I tried removing Essentials, because I figured Essentials v2.12 probably screwed up /unlimited somehow using displaynames, but the problem still persisted, and it wasn't until I downgraded ItemRenamer back to v1.6.2 that it stopped duplicating the items.
Perhaps the problem is only a plugin setting I am unaware of.
@aadnk
That seems to have fixed the issue.
@pilvimaa
Hm. Interesting, looks like the client is throwing away the custom NBT tag I use to restore the item in creative mode.
Could you try this version then? It should work better. :)
@aadnk
Latest dev build threw an error at me on starting the server. Error is pasted here:
http://dev.bukkit.org/paste/apt5hx3fslqj12ve/
About the earlier bug. The problem is partially fixed. You can now see who wrote the book but the title is still the one you used with /itemrenamer set name NameHere instead of the one you used as the title of the book when you signed it.
@pilvimaa
Thanks for the bug report. :)
It should be fixed in the latest developer build. Let me know if that works for you.
I found a possible bug.
When you set name for book & quill (386:0) it will also set this name for signed books which are supposed to have altogether different ID (387:0). Trying to unset name for 387:0 doesn't seem to help. All signed books are named "book & quill".
Removing name from book & quill 386:0 helps with subsequent signed books but if the book was signed while the name was set the name sticks, which is kind of strange. If I understood correctly from the descriptions of ItemRenamer this should not happen - ever - itemrenamer only replaces packets. But .. it's still happening. The names stick even after removing the name from book & quill - if you sign a new book after removing the name from book & quill the signed book is normal. But the old ones are not.
I already did the translation. It took me some hours to complete it using the command interface. It seems to be working perfectly with no down side to it. Few of the items, for example shears and fishing rod got 0 as their data value while other items got "other". This made the translation work only when the item was undamaged but was easy to fix. As other items like swords, axes, armours, etc did not show this behaviour (they also had other as their data field) I can't but wonder if this is a small bug in the code. (/itemrenamer set hand, /itemrenamer set name <name>)
Also enchanted books are a bit different now. They are peculiar. In vanilla when you view them with mouse the name is yellow. When you view them in quick bar the name is white -> so, when you translate/change the name with itemrenamer you will have to choose between yellow everywhere or white name everywhere. A small thing really but I wonder what prompted Mojang to implement this kind of behaviour in the first place for one single itemtype. As far as I know you don't see it happen anywhere else. Perhaps it's a bug in vanilla as it seems inconsistent.
@pilvimaa
You can actually specify which players that should see the translation - just take a look at player-specific packs in the configuration.
I wouldn't worry about any performance impact - the amount of data processed is negligible, and ProtocolLib is very efficient at intercepting packets (especially on Spigot). That being said, nothing is free, so you could try to measure the actual processing time using the ProtocolLib-command /protocol timings.
It will generate a report file containing the exact amount of time spent per packet per plugin, along with the total amount of time on the main thread. This is the figure you should look for, and divide by the number of seconds (or ticks) elapsed in the measurement. That should put any doubts at rest.
@pilvimaa
Ah, yeah. Ups. :P
It's now gone in the latest development build, but luckily it didn't cause any real problems.
@pilvimaa
I've added a description to the default configuration:
It's basically a hack to prevent the server from happily combining renamed items.
@TommehRRR
Thanks.
I definitely think that is an oversight - glowing items should appear glowing as long as the player observing it would see the item glowing in the inventory. So ... I figured I'd give it a go, thinking it wouldn't take long to implement.
Trouble is, I didn't anticipate that feature back when I implemented the API, so I had to create a custom "equipment" inventory to fit into the InventoryView I pass to the API clients ... Took a while, but it should be working fine. :)
As for customizing durability - yeah, that's another oversight. It should have been implemented as a new key (like name or lore), not as a custom enchantment. But, it's not difficult to make the enchantment level dictate the final durability. :P
Also "stackrestrictor: true" option in config doesn't seem to be explained anywhere. Ok, I get it, it somehow restricts stacks... but... ? What does that mean?
Is there an error in the example config or perhaps I just don't understand the purpose of this line here:
At first I was like "pffft, of all the ideas..." then I was like "wait, this does what exactly? Oh, protocollib, thats cool..." then I was like "wait, what? aadnk develops this? I will HAVE to get this to my server."
:-)
I have server that is in my native tongue, Finnish, and I have unique custom items on my server: for instance spoiled meat (which is not apparent until you eat it, the item has the same name). But if you use English language pack you will have all other normal names in English and all the custom items in Finnish which is... quite a big spoiler and enables you to cheat.
I was thinking of translating all the item names with this plugin and effectively forcing people to use Finnish language. That will probably make a few people angry that abhor the Finnish translations of the item names but... it happens.
Can you tell me what kind of strain will this put on the server? I don't have that many players, perhaps 30 online on a good day. But constantly replacing packets on the fly makes me wonder.
Thank you.
Great Update, Glad it's out there! Nice work, aadnk!
Also, i noticed that glowing item's don't appear for other users, i know that is how this plugin works - but maybe in the future that could add a final touch to things.
On a second note, why not allow to specify our own durability?
Thanks very much :)
I see you like my enchant glow idea huh? :D
@aadnk
Cool thanks.
@jjacobson
Sure - just use the NO_ATTRIBUTES "enchantment". Just select the item you want to rename in your inventory bar, and type in the following:
Or you can add it directly to the configuration file:
@aadnk
Is it possible to remove the annoying "+7 damage" lines on swords and stuff? Or is that client side?
@Mre30
Thanks. :)
But in your case, I don't think I would use ItemRenamer. Just rename the items (and add lore) normally using ItemMeta.
@aadnk
It works now.
I was like... great... no WAY is this guy going to believe me xD
Hands down.... I love this plugin. And might I add.... your coding skills are off the wall!
You, if you don't already, have a bright future in coding my friend.
I was giving some thought to an API.... could I, example, make it to where... say.... if a player breaks a diamond ore, the ore is renamed with 'Username's diamond'
OR... if a player kills a creeper and a creeper head drops. The lore is added with 'Killed by Username' ??
@Mre30
Ah, I think I found the problem. Must have broken an earlier patch when I introduced the new ItemRenamer API.
You can get the updated version here.