Let's say you have your data pack folder as data/survivor/items and in this folder there is a file called big_sword.json with this content
{
"tags": ["minecraft:swords", "minecraft:tools/swords"],
"functions": [
{
"function": "minecraft:set_attributes",
"modifiers": {
"name": "generic.attack_damage",
"attribute": "minecraft:generic.attack_damage",
"operation": "addition",
"amount": 10,
"slot": "mainhand"
}
},
{
"function": "minecraft:set_attributes",
"modifiers": {
"name": "generic.attack_speed",
"attribute": "minecraft:generic.attack_speed",
"operation": "addition",
"amount": -0.25,
"slot": "mainhand"
}
},
{
"function": "minecraft:set_lore",
"lore": [
[
{
"text": "A big sword that not ",
"color": "white"
},
{
"text": "everyone",
"bold": true,
"color": "gold"
},
{
"text": " can hold in hands",
"color": "white"
}
]
]
}
],
"durability": 736 // If there is no durability prop, the item will have unlimited uses
}
This feature, in addition to all the features of the data pack, allows us to customize the game mechanics as mods and better use of commands such as
give @s survivor:big_sword
execute as @a[nbt={SelectedItem:"survivor:big_sword"}] run ...
Thanks for taking the time to read this and maybe adding it ❤️
Please sign in to leave a comment.
0 Comments