ID System (Item & Block ids)
Minecraft has stopped using their legacy id system from the 1.13 update and up-wards. That means that legacy id's will only work for 1.8.*-1.12.* . This ID system has been created to help with this.
It is recommended to use Blocks.Instance.GetId in the Start function of your ITask class, and store results in variables for the whole class to use. This is considered best practice for performance.
You can find item id name's in such sites: https://minecraftitemids.com/, https://www.minecraftinfo.com/idlist.htm, https://www.deadmap.com/idlist ...
Blocks
The simplest form of getting a numeric id for both legacy ids (1.8-1.12) and the flattened ids is to use the static Blocks.Instance global variable.
Example usage:
Note how GetId() returns a ushort?, this means that in cases where the passed string, in this case "minecraft:resdstone_lamp" is not a valid or a matching name, then null is returned.
This null mechanism is useful in casses where Minecraft uses different names for different versions, as in some cases you can do the following:
Block more utility
There are also more functions on Blocks.Instance that make it easier to work with ids. The notable ones are:
Blocks.Instance.GetIds - get an array of ids for an array of inputs, example usage:
...
Items
Item ids work in the exact same way as the Block system, except it uses *Items*.Instance.GetId, instead of *Blocks*.Instance.GetId!
Example usage:
Note how GetId() returns a ushort?, this means that in cases where the passed string, in this case "minecraft:fishing_rod" is not a valid or a matching name, then null is returned.
This null mechanism is useful in casses where Minecraft uses different names for different versions, as in some cases you can do the following:
Items more utility
There are also more functions on Items.Instance that make it easier to work with ids. The notable ones are:
Items.Instance.GetIds - get an array of ids for an array of inputs, example usage:
...
Last updated