Initial
This commit is contained in:
commit
1f861cba2b
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
* text=auto
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.zip
|
2
data/custom_item_model_data/function/enable.mcfunction
Normal file
2
data/custom_item_model_data/function/enable.mcfunction
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
scoreboard players set @s CustomModel 0
|
||||||
|
scoreboard players enable @s CustomModel
|
5
data/custom_item_model_data/function/init.mcfunction
Normal file
5
data/custom_item_model_data/function/init.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
scoreboard objectives add CustomModel trigger
|
||||||
|
scoreboard players set @a CustomModel 0
|
||||||
|
scoreboard players enable @a CustomModel
|
||||||
|
|
||||||
|
function custom_item_model_data:second
|
@ -0,0 +1,9 @@
|
|||||||
|
item modify entity @s weapon.mainhand \
|
||||||
|
{\
|
||||||
|
function:set_components, \
|
||||||
|
components: {\
|
||||||
|
"!minecraft:custom_model_data": {} \
|
||||||
|
}\
|
||||||
|
}
|
||||||
|
title @s actionbar [{"text": "Custom Model Data ", "color": "green"},{"text": "removed", "color": "red"}]
|
||||||
|
execute at @s run playsound minecraft:entity.villager.work_cartographer player @s ~ ~ ~ 0.6 0.6
|
7
data/custom_item_model_data/function/second.mcfunction
Normal file
7
data/custom_item_model_data/function/second.mcfunction
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
schedule function custom_item_model_data:second 1s
|
||||||
|
|
||||||
|
execute as @a[scores={CustomModel=1}] if items entity @s weapon.mainhand * run function custom_item_model_data:trigger
|
||||||
|
execute as @a[scores={CustomModel=2..}] if items entity @s weapon.mainhand * run function custom_item_model_data:remove_model
|
||||||
|
|
||||||
|
# resets trigger
|
||||||
|
execute as @a run function custom_item_model_data:enable
|
@ -0,0 +1,9 @@
|
|||||||
|
$item modify entity @s weapon.mainhand \
|
||||||
|
{\
|
||||||
|
function:set_components, \
|
||||||
|
components: {\
|
||||||
|
"minecraft:custom_model_data": { "strings": [ $(Model) ] } \
|
||||||
|
}\
|
||||||
|
}
|
||||||
|
$title @s actionbar [{"text": "Set Custom Model Data to ", "color": "green"},{"text": "$(Model)", "color": "aqua"}]
|
||||||
|
execute at @s run playsound minecraft:entity.villager.work_cartographer player @s ~ ~ ~ 0.6 0.6
|
7
data/custom_item_model_data/function/trigger.mcfunction
Normal file
7
data/custom_item_model_data/function/trigger.mcfunction
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
execute as @s run data remove storage custom_item_model_data:item_model Model
|
||||||
|
execute as @s run data modify storage custom_item_model_data:item_model Model set from entity @s Inventory[{Slot:-106b}].components.minecraft:writable_book_content.pages[0].raw
|
||||||
|
execute as @s run function custom_item_model_data:set_model with storage custom_item_model_data:item_model {}
|
||||||
|
|
||||||
|
execute as @s run scoreboard players reset @s CustomModel
|
||||||
|
scoreboard players set @s CustomModel 0
|
||||||
|
scoreboard players enable @a CustomModel
|
5
data/minecraft/tags/function/load.json
Normal file
5
data/minecraft/tags/function/load.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"custom_item_model_data:init"
|
||||||
|
]
|
||||||
|
}
|
10
pack.mcmeta
Normal file
10
pack.mcmeta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"pack": {
|
||||||
|
"pack_format": 61,
|
||||||
|
"supported_formats": {
|
||||||
|
"min_inclusive": 61,
|
||||||
|
"max_inclusive": 61
|
||||||
|
},
|
||||||
|
"description": [{"text":"Custom Model Data","color":"gold"},{"text":"\nDatapack by LZ Stealth","color":"green"}]
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user