Unbreakable Items
Do epic mobs or weapons destroy your armor like that <snap!>? Don't like having to recreate armor all the time? Or wish your super-epic gold weapon wouldn't wear out so quickly? Unbreakable will make it never wear out.
Unbreakable is a simple idea, inspired by @shoter : don't allow armor or weapons to break when hit, especially when it is hit hard. It does so not by the unbreaking enchantment, which only slows down the inevitable, nor by repeatedly repairing your item, which both is a heavy server load and no good if it breaks, but by a new feature hidden in 1.7.2 Minecraft to make some things never break.
By design this plugin is very lightweight. It only fires when an item breaks, and only does that once per item. Or, (since 1.5) you can now configure it to be a little more active and pre-mark items as unbreakable before they are even used. Have had a lot of requests for this feature, so hope you're happy.
Description
The first time your item breaks, it will immediately be given back to you with an Unbreakable tag, which you can see when mousing over the item. All attributes, metadata, and tags are retained.
Alternatively (since in 1.5) you can now avoid items getting "used up" and appearing to break by setting Unbreakable before break config items.
Enchanting
If you turn off automatic protection for a user (using permissions or world-specific settings), this may be useful: Unbreakable now can appear in enchanting table.
Also supports enchanting books and using them on an anvil.
Caveats
- Since version 4, requires Spigot (spigotmc.org) for Minecraft 1.9 or later; but still backward compatible with Minecraft 1.8.
- some plugins that manage tool/weapon breaking on their own do not respect the new Unbreakable tag, and so will still damage the item. Suggest submitting a feature request to the plugin author to respect it.
- Only works with version 1.7.2-R0.2 or greater.
4. Unbreakable tag not restored through server stop/save/restarts and right clicking to place one [v.2.0]. Known Bukkit issue.
Configuration
Copies default config.yml to plugins/Unbreakable/ if none exists. If you want to skip to examples, go to this page here.
Three config items control what is automatically made unbreakable. "Weapons" means only swords and bows. "Tools" means everything else. Names and defaults below:
- Protect armor: true
- Protect weapons: true
- Protect tools: true
- Protect elytra: true[4.7]
Shields are categorized as tools above. [NEW in 4.1]
One more item (in 1.6) allows tagging only certain unique items as unbreakable, by finding a string in its Lore. If you configure this string and that string is found within any item's Lore, that item will become unbreakable without checking user permissions or World-based controls. Example below:
Lore unbreakable string: Unbreakable
If you do not want a message to players when their item becomes unbreakable, make a plugins/Unbreakable/config.yml with the one line:
Message on making unbreakable: false
You can change default to not repair items when making Unbreakable. Preserves the damage value, commonly referred as data value. For consistency with previous versions, default is to do a repair as per below, setting it to zero.
Also repair: true
Unbreakable display
You can now set whether or not the Unbreakable tag is displayed to players. Just set the Hide Unbreakable flag to false. [New in 4.2]
You can also set custom lore when an item is made unbreakable. You can use this, for example, to make "Unbreakable" appear where enchantments appear. New item is a list of strings called Enchant lore. Caution: this will replace any lore already on the item before making it unbreakable. [New in 4.2]
Enchant lore: - line 1 - §1line 2 in blue - line 3 - line 4
Color codes are allowed in above lore.
Book lore
Note that you can also customize the lore that is added to an enchanted book with Unbreakable in it using the LanguageAPI. See Languages and Translation page for details.
Unbreakable before break
By default items are only marked Unbreakable once they break since this is the least server load, but it can make your users nervous when their items appear to be wearing out. You can now pre-mark automatically protected items (i.e. one or more Protect armor/weapons/tools/elytra is set) as Unbreakable, based on different events. Select the ones you prefer based on acceptable server load. They are presented roughly in increasing server load. All default to false.
- Unbreakable on pickup: if true, all protected items picked up by a player (who has permission) will become unbreakable.
- Unbreakable on spawn: if true, all protected items spawned on ground (ex. when dropped) will become unbreakable.
- Does not check player permissions, so if this marks an item anybody can pick it up.
- Unbreakable on hold: if true, any protected item moved to hand or worn will become unbreakable.[in 1.6]
- Note that since elytra never breaks, but stays unusable at 1 remaining durability, for it on hold is always true [4.7].
- Unbreakable on join: if true, all protected & permitted items in a player's inventory will become unbreakable when he joins server or moves worlds.
- may not work with plugins adding nested inventory items like backpacks.
- Breakable on leave world: if true, removes all Unbreakable tags on items in a player's inventory when she leaves a protected world to an unprotected one.
- only effective if Auto fix worldlist is set; see below
- Caution: can remove legally Unbreakable enchants from items.
World-based controls
Can configure automatic protections and enchanting only for certain worlds. If not set, both default to all worlds. If you use these, may wish to use a world-specific inventory plugin like MultiInv or Entei's Inventory Manager to keep inventories from Unbreakable worlds from moving to other worlds, or v.v..
- Auto fix worldlist: list of worlds in which auto-fixing by event and/or item type is active
- only applies to Protect armor/weapons/tools, that is,
- Lore unbreakable string if set applies to all worlds regardless of this since the item always has such lore
- Enchanting worldlist: list of worlds in which Unbreakable enchanting of items or books is permitted.
Examples:
Auto fix worldlist: - pvp_world Enchanting worldlist: - survival_world - adventure_world
Config for Enchanting
Four items control enchanting behavior. First controls whether a message is sent to the player enchanting, second applies when using an anvil, and last two control the mechanics of enchanting with a book storing Unbreakable. Latter two are embedded into the book lore. Defaults are below.
Message on enchant: false Message on enchant cancel: true // using Unbreakable books Anvil enchant delay sec: 5 Anvil enchant cost: 3
Permissions
Has a corresponding permission so that you can give individuals by user/group. Use is optional and all default to false [CHANGED in 4.1]. Note that these only apply to automatic triggers from Protect armor/weapons/tools and are NOT checked if Unbreakable on spawn is true or if Lore unbreakable string is set and triggered.
- unbreakable.armor
- unbreakable.weapons
- unbreakable.tools
- unbreakable.elytra [4.7]
Enchanting is controlled by the following permissions, with shown defaults:
- unbreakable.cmd: Allows enchanting held item with Unbreakable by unbk command
- default: op
- unbreakable.ench: Allows enchanting item with Unbreakable on Enchant table
- default: true
- unbreakable.anvil: Allows enchanting an item with an Unbreakable book on anvil
- default: true
Commands
One command: unbk which enchants the held item with Unbreakable.
The command supports an optional parameter, off or false, which if provided removes Unbreakable from the held item. No XP is restored. [New in 4.6]
Multiple Language Support
Supports multiple languages. See Languages and Translation page for details.
In Progess
- Add a list of items to protect by material name string and durability range.
Future Ideas
- Add similar functionality for similar Invulnerable tag, which means it can't be destroyed when dropped, even by lava.
Add Protect elytra [4.7]
Add option to unbk command to remove Unbreakable, perhaps "/unbk off".
MC1.9 Compatibility.
Add 1.8 compatibility. May make Spigot-specific since it added a Spigot-API for Unbreakable()
Add backward-compatibility to 1.7.2 or build a "1.6 for 1.7.2" version of plugin.[Added 2.0]
Allow for making an item unbreakable by finding a certain string within Lore.
Add config flag to make things unbreakable before they "break". Will be higher load on server.
Command-line enchant
Enchantment for Unbreakability.
Configurable whether armor, weapons, or tools are unbreakable.
Permissions for the same.
Less version dependency, perhaps using reflection to allow forward-compatibility. Fail gracefully on old versions.
LanguagesAPI, for translations.
How can i allow my server to use this tag (i'm on craftbukkit 1.7.2_Ro3 and don't have any config.yml file)
@pandapipino
Per above, if you have Lore unbreakable string set, "that item will become unbreakable without checking user permissions or World-based controls".
If you still have questions, please attach your config.yml
Auto fix worldlist: - world_test
Breakable on leave world: true
this config is not working for me, i left world_test and go to another world but the Unbreaking lore is still there.
3.1 is now formally in Release state. Have fun and let me know of any issues!
@filbert66
Just released 3.1 as beta. Should be everything working.
Also, verified that in Spigot 1.8.8, Unbreakable tag is retained through server stop/starts!
Working on a 1.8-compatible version. Try the alpha version if you want. It works for event-based unbreakable, or command, but haven't gotten the enchant table or anvil working yet.
Under the commands section, it lists unbk as being able to make items in your hand unbreakable. I have tried this and it doesnt work. Is this a typo or is there even a command for this?
@harvik
Added a new example to the Example Configs page here.
I only want to have unbreakable items when using the command and not when it breaks. How can i configure this?
@fraz86
Just posted version 2.0, which now works with either 1.7.2 or 1.7.9!
2.0 also applies a patch to shift-click problem. Let me know if you still have a problem with it removing, especially if you can duplicate it reliably.
Update: Yayz! There still are Bukkit staff around working. Thanks, guys!
@fraz86
Don't know. I don't normally support Dev builds.
I'd like to make it independent of Bukkit versions, though that is challenging and I am still working on it.
Does this work in 1.7.10?
Does this work in 1.7.10?
@KTJx2
Hmm.. what is your 'Lore unbreakable string' in your config.yml? Default is not set, so it won't work unless you set it. Then what Lore string is in your item? Can you send a screen shot?
How did you put it on? I did a left click and placed all. It stayed unbreakable for me. See Caveat#3: you cannot right-click since that creates a new stack. I suppose I could add a right click listener...
The lore doesn't seem to work for me..? Also, when using /unbk on armor, it works, until I put it on. Then it disappears.
@filbert66
Gotcha lol would rather keep It from crashing, and will the next version support backwards compatibility?
@NaviLlicious
That makes sense. Adding the enchant doesn't really make it unbreakable anyhow; my plugin needs to add the tag. Furthermore, if the Unbreakable enchant is added, it can crash the client if the item is subsequently placed in anvil or table.
Best to pursue the lore-based trigger. Now deciding whether or not lore should respect Auto fix worldlist or not. Thinking not so that you can have unbreakable items in worlds where items don't fix themselves.
@filbert66
Would It be possible to set this up through EnchantmentAPI? I know you can make custom enchantments on that but can't wrap my head around It lol
@NaviLlicious
Enchant name is just that, UNBREAKABLE. Enchant ID I used was 144, if you needed that too.
Also adding a feature now to make an item Unbreakable by a detecting a specific string in it's lore. That may work for you, to make sure that stay that way.
@filbert66
Thank you and Is there a way to make It so the enchantment for unbreakable Is on a custom weapon? I'm using the LegendaryWeapons plugin and he had a bunch of custom enchants that worked with It do you think It would be compatible with that plugin? I'm basically looking to make lootable weapons that don't break but also have It so player created weapons do break and still have tons of enchantment options, Is there a coded name for the unbreakable enchant or Is It just unbreakable?