Minecraft Blogs / Tutorial

Enchantment ID Tip for Command Maniacs

  • 363 views, 1 today
  • 2
  • 0
ClassyElm's Avatar ClassyElm
Level 49 : Master Engineer
25
Hello again! Before reading this blog, if you're not a command maniac, you might not understand what I'm talking about. Read at your own risk. This is an unusual thing for me to do because normally I'm out there map-making or creating a new one command creation. What I'm doing here is giving a useful tip/tutorial on enchantment IDs. No, this is not a list of all IDs, this is some really useful feature of Minecraft's enchantment IDs I stumbled upon. Let's get straight to the point.

While messing around with the IDs, I found that you can use a string in the place of an enchantment ID. For example:

Diamond 1: "/give @p diamond 1 0 {ench:[{id:0,lvl:1}]}" will give you a diamond with protection I. Notice the id:0? That's the enchantment ID. If you use a command like this:

Diamond 2: "/give @p diamond 1 0 {ench:[{id:Hello,lvl:1}]}" you will get a diamond with protection I.

Now you might be asking, hey Classy, why does using a string make a difference if they both come out to the same enchantment? Well here's why. If you throw both diamonds on the ground and run the "/entitydata @e[type=Item,r=10] {}" command to compare the items' data, you'll notice that diamond 1 (With ID 0) will say it has an enchantment ID of 0 and diamond 2 will say it has an ID of "Hello". This is extremely useful to us command maniacs because we can now identify items based off an enchantment ID. We don't need to worry about the name of the item, or even the item ID itself. We're able to do so much more with this. This is pretty much a scoreboard tag we can add to items in a player's inventory instead of an entity.

Why do you always get protection I on an item with a string for an enchantment ID
Minecraft's "default" enchantment is ID 0 (Protection). When an item has an unrecognizable enchantment ID(Ex. A string as an ID), Minecraft automatically just sets it to protection, but does not remove the string enchantment ID. This feature gives us access to detect an item's enchantment ID, even if it is a string.
DISCLAIMER
Even though you set a string as the enchantment ID, the string is not the displayed enchantment on the item. Protection is always going to be displayed, no matter what string you use as the enchantment ID.



I hope this is useful to any of you command maniacs. If you've got any further questions about this, just be sure to leave a command, I mean comment, in the comment section below and if you've enjoyed this blog, please leave a diamond. Can't wait for the next post I make.
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome