- check_circle Functions
Published Nov 7th, 2022, 11/7/22 8:45 pm
- 3,296 views, 2 today
- 138 downloads, 0 today
Required Resource Pack
13
Customize your world!
With this Datapack, you can change the models and textures of your items.
This Datapack allows you to modify the CustomModelData tag of any item at will. On its own this does nothing, but paired with a resource pack, this allows you to make your items look like anything you want.
To change an item, you have to hold the item and use a command. This is a trigger command that anyone can use.
To use the command, type /trigger rp_ApplyModel set <number>
The number will be the value you set the CustomModelData tag to. Keep in mind this Datapack only supports numbers 1-5 for now.
If I wanted to give something CustomModelData of 2, for instance, I would type /trigger rp_ApplyModel set 2.
With this Datapack, you can change the models and textures of your items.
This Datapack allows you to modify the CustomModelData tag of any item at will. On its own this does nothing, but paired with a resource pack, this allows you to make your items look like anything you want.
To change an item, you have to hold the item and use a command. This is a trigger command that anyone can use.
To use the command, type /trigger rp_ApplyModel set <number>
The number will be the value you set the CustomModelData tag to. Keep in mind this Datapack only supports numbers 1-5 for now.
If I wanted to give something CustomModelData of 2, for instance, I would type /trigger rp_ApplyModel set 2.
Credit | Bello666 for original sword texture |
Compatibility | Minecraft 1.14 |
to | Minecraft 1.19 |
Tags |
tools/tracking
5763636
119
roleplay-items-v1-customize-your-items
Create an account or sign in to comment.
With your version of it, you are using the /item command that only appeared in 1.17 so you can't claim your datapack is 1.14 compatible.
A better way (in my opinion) to achive your goal is to run a function as all player that triggered the score.
In this function, you can copy player score to a storage and then use an item_modifier to modify the item CustomModelData from the storage by using the copy_nbt tag.
It would look something like this :
tick.mcfunction : execute as @a[scores={rp_ApplyModel=1}] run function rp_items:apply_model
apply_model.mcfunction : execute store result storage temp CMD int run scoreboard players get @s rp_ApplyModel
item modify entity @s weapon.mainhand rp_items:apply_model
apply_model.json :
[
{
"function": "minecraft:copy_nbt",
"source": "minecraft:temp",
"ops": [
{
"source": "CMD",
"target": "CustomModelData",
"op": "replace"
}
]
}
]
I may have made syntax mistakes so feel free to ask if something isn't working properly.
With these changes, you will be able to use any number as a CustomModelData without having to hardcode each and every single value.
I hope this will help you.
Also, sorry that it says 1.14+, it autofilled a version and I forgot to check.