Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions data/bored-face.pose/function/cape.mcfunction
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# called when clicked in the smartphone

$execute as @n[type=minecraft:item_display, distance=..3, nbt={item:{components: {"minecraft:item_model": "bored-face.pose:cape"}}}] run \
data modify entity @s item.components.minecraft:custom_model_data.strings[0] set value "$(id)"
# Update all loaded capes from versions prior to 2.0
execute as @n[type=minecraft:item_display, distance=..3, nbt={item:{components: {"minecraft:item_model": "bored-face.pose:cape"}}}] run function bored-face.pose:misc/update_cape

$execute as @n[type=minecraft:item_display, distance=..3, nbt={item:{components: {"minecraft:custom_data": {"cape": {}}}}}] run \
data modify entity @s item.components.minecraft:item_model set value "bored-face.pose:cape/$(id)"
3 changes: 3 additions & 0 deletions data/bored-face.pose/function/load.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ execute unless data storage bored-face.pose:data skins run function bored-face.p
function bored-face.pose:load/footer

function bored-face.pose:reload_smartphone

# Update all loaded capes from versions prior to 2.0
function bored-face.pose:tool/update_capes
2 changes: 2 additions & 0 deletions data/bored-face.pose/function/misc/update_cape.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data modify storage bored-face.pose:smartphone tmp.id set from entity @s item.components.minecraft:custom_model_data.strings[0]
function bored-face.pose:misc/update_cape/macro with storage bored-face.pose:smartphone tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data remove entity @s item.components.minecraft:custom_model_data
$data modify entity @s item.components.minecraft:item_model set value "bored-face.pose:cape/$(id)"
data modify entity @s item.components.minecraft:custom_data.cape set value {}
4 changes: 2 additions & 2 deletions data/bored-face.pose/function/players/cardboard.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ summon minecraft:item_display ~ ~1.133 ~ { \
id: "minecraft:item_display", \
item: { \
components: { \
"minecraft:custom_model_data": {strings: ["bored"]}, \
"minecraft:item_model": "bored-face.pose:cape", \
"minecraft:custom_data": {cape: {}}, \
"minecraft:item_model": "bored-face.pose:cape/bored", \
}, \
count: 1, \
id: "minecraft:barrier" \
Expand Down
4 changes: 2 additions & 2 deletions data/bored-face.pose/function/players/handstand.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ summon minecraft:item_display ~ ~0.9187 ~ { \
{ \
id: "minecraft:item_display", item: { \
components: { \
"minecraft:custom_model_data": {strings: ["bored"]}, \
"minecraft:item_model": "bored-face.pose:cape", \
"minecraft:custom_data": {cape: {}}, \
"minecraft:item_model": "bored-face.pose:cape/bored", \
}, \
count: 1, \
id: "minecraft:barrier", \
Expand Down
4 changes: 2 additions & 2 deletions data/bored-face.pose/function/players/happy.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ summon minecraft:item_display ~ ~1.1185 ~ { \
{ \
id: "minecraft:item_display", item: { \
components: { \
"minecraft:custom_model_data": {strings: ["bored"]}, \
"minecraft:item_model": "bored-face.pose:cape", \
"minecraft:custom_data": {cape: {}}, \
"minecraft:item_model": "bored-face.pose:cape/bored", \
}, \
count: 1, \
id: "minecraft:barrier", \
Expand Down
8 changes: 4 additions & 4 deletions data/bored-face.pose/function/players/high_five.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ summon minecraft:item_display ~ ~1.0976 ~-0.65 { \
{ \
id: "minecraft:item_display", item: { \
components: { \
"minecraft:custom_model_data": {strings: ["none"]}, \
"minecraft:item_model": "bored-face.pose:cape" \
"minecraft:custom_data": {cape: {}}, \
"minecraft:item_model": "bored-face.pose:cape/none", \
}, \
count: 1, \
id: "minecraft:barrier", \
Expand Down Expand Up @@ -141,8 +141,8 @@ summon minecraft:item_display ~0.0757 ~1.0886 ~0.6219 { \
{ \
id: "minecraft:item_display", item: { \
components: { \
"minecraft:custom_model_data": {strings: ["none"]}, \
"minecraft:item_model": "bored-face.pose:cape" \
"minecraft:custom_data": {cape: {}}, \
"minecraft:item_model": "bored-face.pose:cape/none", \
}, \
count: 1, \
id: "minecraft:barrier", \
Expand Down
4 changes: 2 additions & 2 deletions data/bored-face.pose/function/players/normal.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ summon minecraft:item_display ~ ~1.124 ~ { \
id: "minecraft:barrier", \
count: 1, \
components: { \
"minecraft:item_model": "bored-face.pose:cape", \
"minecraft:custom_model_data": {strings: ["vanilla"]}, \
"minecraft:custom_data": {cape: {}}, \
"minecraft:item_model": "bored-face.pose:cape/vanilla", \
}, \
}, \
transformation: { \
Expand Down
4 changes: 2 additions & 2 deletions data/bored-face.pose/function/players/run.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ summon minecraft:item_display ~ ~1.048 ~ { \
{ \
id: "minecraft:item_display", item: { \
components: { \
"minecraft:custom_model_data": {strings: ["bored"]}, \
"minecraft:item_model": "bored-face.pose:cape" \
"minecraft:custom_data": {cape: {}}, \
"minecraft:item_model": "bored-face.pose:cape/bored", \
}, \
count: 1, \
id: "minecraft:barrier", \
Expand Down
4 changes: 2 additions & 2 deletions data/bored-face.pose/function/players/sneak.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ summon minecraft:item_display ~ ~0.9966 ~ { \
{ \
id: "minecraft:item_display", item: { \
components: { \
"minecraft:custom_model_data": {strings: ["bored"]}, \
"minecraft:item_model": "bored-face.pose:cape", \
"minecraft:custom_data": {cape: {}}, \
"minecraft:item_model": "bored-face.pose:cape/bored", \
}, \
count: 1, \
id: "minecraft:barrier", \
Expand Down
2 changes: 2 additions & 0 deletions data/bored-face.pose/function/tool/update_capes.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#execute as @e[type=minecraft:item_display, nbt={item:{components: {"minecraft:item_model": "bored-face.pose:cape"}}}] run function bored-face.pose:misc/update_cape
execute as @n[type=minecraft:item_display, nbt={item:{components: {"minecraft:item_model": "bored-face.pose:cape"}}}] run function bored-face.pose:misc/update_cape