What's new

How to make a custom item have a item id.. And NBT Tags..

pinkpig3777

Member
Joined
Jun 23, 2016
Messages
211
The KingsCrown that the Skeleton King drops breaks really fast. So, I originally wanted it to have unbreaking 10 or something but that didn't work. Now I want it to be unbreakable because it's extremely rare on my server so it should last a long time.

The problem is, there appears to be no way to do that. The only method I've found that might work is adding a NBT tag to it.
There are 2 methods I have in mind.
1. The /give command that has "{Unbreakable:1/0} (1 = true, 0 = false)" as the NBT tag, and the command is activated on the mob's death, (the player who killed it, would have a 0.05 chance at having the command activated and giving them the item).
I'd also need help on how to get the /give have a chance to activate on the mob's death.

2. Adding a NBT tag directly to the item. So when it drops, it's already unbreakable. This sounds the most simple, but I have no idea how to do it.

If you know how to solve my problem, please let me know!
Keep in mind: I'm still pretty new to all Server/Plugin things. Please keep it very easy to understand :p
 

pinkpig3777

Member
Joined
Jun 23, 2016
Messages
211
When I set it to true, it doesn't work. I tested it by spawning in a mob and the helmet took damage.

EDIT: Btw is there a way to make the item have a unique item id? Because this plugin:
http://dev.bukkit.org/bukkit-plugins/unbreakableequip/ gives you a permission node that makes a selected item id, unbreakable using the permisison node:
unbreakable.X
(replace X with item ID) Single-item mode, you can use these permissions to set per-item configuration :)
example: "unbreakable.276" to have diamond swords unbreakables

EDIT 2: Assuming the plugin I mentioned above works on a 1.8.8 server. It was made for 1.7 :/

EDIT 3: A screenshot to show what I put in and doesn't work:
http://prntscr.com/by979t
 
Last edited:

Frizo

New Member
Joined
Jul 27, 2016
Messages
12
I also tried unbreakable: true and could not get it to work.
I did notice the problem is a gold helm has only 77 durablity and diamond 363. Perhaps a switch to keep it long lasting?
Like this maybe? I hope it helps.
Code:
KingsCrown:
  Id: diamond_helmet
  Data: 0
  Display: '&dCrown of the King'
  Lore:
  - '&6A kingly crowl that grants'
  - '&6the wearer unwavering power!'
  Amount: 1
  Attributes:
    Head:
      Armor: 2
      ArmorToughness: 3
      Health: 10
      KnockbackResistance: 10
  Enchantments:
  - PROTECTION_ENVIRONMENTAL:2
  - PROTECTION_PROJECTILE:2
  - PROTECTION_FIRE:2
  - PROTECTION_EXPLOSIONS:2
  - DURABILITY:3
 

pinkpig3777

Member
Joined
Jun 23, 2016
Messages
211
I also tried unbreakable: true and could not get it to work.
I did notice the problem is a gold helm has only 77 durablity and diamond 363. Perhaps a switch to keep it long lasting?
Like this maybe? I hope it helps.
Code:
KingsCrown:
  Id: diamond_helmet
  Data: 0
  Display: '&dCrown of the King'
  Lore:
  - '&6A kingly crowl that grants'
  - '&6the wearer unwavering power!'
  Amount: 1
  Attributes:
    Head:
      Armor: 2
      ArmorToughness: 3
      Health: 10
      KnockbackResistance: 10
  Enchantments:
  - PROTECTION_ENVIRONMENTAL:2
  - PROTECTION_PROJECTILE:2
  - PROTECTION_FIRE:2
  - PROTECTION_EXPLOSIONS:2
  - DURABILITY:3
I've already changed it to a diamond helmet before you posted this :p it still breaks too fast.

Thanks though!
 
Top