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.
Can you please add a feature where you can enable unbreakable on all items in a GUI
Love this plguin, hope you update it to 1.12!
It works flawlessly, couldn't be better!
The config is easily customised and is easy to navigate.
Thanks for this amazing plugin :D
How do i install this Plugin?
I have installed Minecraft normal, without any additional mods, modpacks or installers.
What do i do to install this Plugin? Do i need a modinstaller?
A little step by step instruction would be nice.
This is a Bukkit plugin, as are all on this site. The only way I know of now is to use Spigot which took over support of Bukkit. Suggest starting here.
But since this plugin has made use of extensions to Bukkit API by the Spigot group, so make sure you install Spigot and not plain Bukkit.
@switchbranch
Yes.
Just curious if the plugin is still maintained
why no 1.8.9 :(
@nate9790
To have it unbreakable already when you give it, you can either use the /give command with metadata options or you can use /unbk on it first and then give it to them.
Just posted two more versions. Take 4.5 now for 1.10; wait for 4.5.1 to post for 1.8 backward-compatibility.
Elytra can now be protected.
@dpsparadoxal
Should be able to add Unbreakable with book on top of anything but Unbreaking. I just did it a few times, and it works with Spigot1.10 and UB4.4. What are you using, and what other plugins?
P.S. I think it works on Elytra, but having tried, it doesn't. Working on it
@filbert66
I am doing this correctly? Spawn book and do /unbk command to make the enchanted book. it works on new items. But if an item already is enchanted with say sharpness, when I put it in the anvil with the unbreakable book, it won't enchant it.
PS: Love the plugin btw great work :D
PPS: Support for elytras would be cool! :)
@dpsparadoxal
Already support enchanting books with Unbreakable! Made that about more obvious above.
This plugin looks really cool i'm about to test it on my server. I think a cool idea would be a book with the unbreakable enchantment on it. So i could give a few away during a drop party or something and allow them to add it to whichever item they want with an anvil :)
Just posted version 4.4 with 1.10 compatibility and now protects armor and a shield as you put it on.
NOTE: Per Minecraft code, a shield is not "armor", but a "tool". Hence, it is not protected if Protect armor is true but Protect tools is false.
@filbert66
done
@delsolsi213
I see. I did some work already to detect shift-click (for stacks of items) and armor shot by a dispenser. I must be missing a case. Please detail the exact sequence of events you are talking about in a new ticket.
@filbert66
i tried testing the lore string and it doesnt work, i made it be default Unbreakable and added Unbreakable to the kits items, after spawning them in with /kit it still does not make them unbreakable i have to hold the item or drop it to turn it unbreakable.
EDIT: i think you misunderstood me, what i meant is i want it so the armor turns unbreakable when a player wears it, so they dont have to hold the armor in their hand to turn it unbreakable, most if not all players shift click the armor in, doing this doesnt turn the armor unbreakable. maybe add an option so it turns it when the player wears it? or shift clicks it?
@filbert66
thing is, i want to keep the unbreakable tag hidden therefor this won't work.
@delsolsi213
There are many ways to make things unbreakable. You can use Lore unbreakable string if your kit can create things with lore.