User:Aeldrion/Tutorials/Custom items

Ever since the ability to rename and modify items, command artists have been trying to add their own custom items to vanilla Minecraft. In snapshot 18w43a, the  tag was added, allowing to change the model of any item to be changed depending on an NBT value. Here is an example of a custom item in vanilla Minecraft.

How can I create my own custom items, without replacing default items?

Choosing an item
In 1.14, it is unfortunately still impossible to actually add items to Minecraft, like it is impossible to add entities or blocks. However, it is possible to disguise an existing item as a new one. Therefore, the first step in making your own custom items is choosing what item you are going to use.

Clock
Clocks have a property that most items in Minecraft don't have: it has no functionality. It does change texture depending on daytime, but that relies only on its model, and in fact, with a resource pack, you could do exact same with, say, a string or a cooked potato. They are stackable, they cannot be placed, crafted into another item, cooked or used in any way, which is why they're often the best option for custom items.

Carrot on a stick
The Carrot on a Stick can be used to make your own usable items, because its use stat can be used with scoreboard objectives to detect right-clicking. It does have functionality, however, the ability to attract pigs and to guide them, which can be annoying if you just want to make a new tool or weapon.

Knowledge book
The Knowledge Book has the property of vanishing when it is used, which can be useful if you want to make consumable items.

Applying a texture
Once you have chosen an item, you probably want to give it a different look, so that it just doesn't look like a default item. This can be done using models in resource packs. For this, we are going to use the  tag. This tag acts as a key that indicates to resource packs what model they should use.

Setting CustomModelData
Setting  on your item is pretty easy. You just have to indicate any integer (from -2147483648 and 2147483647) that you will use later in your model. give @s minecraft:stone{CustomModelData:123}

Note: I recommend using a unique prefix so that multiple datapacks don't use the same value. There's a big chance two datapacks may use 1 for CustomModelData, but two datapacks are never going to use 714309. I personally use values between 1512001 and 1512999 because 1512 stands for the AEL in my username.