All files are available on Google Drive: https://drive.google.com/drive/folders/1Yq4bv84eriuOVBz0VNELZOzjzjmFsHTu
Formatted files are valid formatting for functions in a datapack.
Flattened commands are required for input into a command block.
Chained command blocks are designed to function in the order provided.
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:1
#:Title:Midair Block Placer
#:Type_1:Repeat
#:Desc_1:Summon snowball in center of target block
execute \
as @a \
if predicate {\
condition:entity_properties,\
entity:this,\
predicate:{\
equipment:{offhand:{\
items:oxidized_copper_golem_statue,\
components:{block_state:{copper_golem_pose:"star"}}\
}},\
"type_specific/player":{input:{sneak:true}}\
}\
} \
at @s rotated as @s anchored eyes \
positioned ^ ^ ^2.5 \
align xyz \
run summon snowball ~0.5 ~0.625 ~0.5 {\
Tags:[fbf.scaffold],\
Item:{\
id:oxidized_copper_golem_statue,\
components:{block_state:{copper_golem_pose:"star"}}\
},\
NoGravity:1b,\
PortalCooldown:2\
}
#:Type_2:Chain
#:Desc_2:Replace air with structure void
execute \
as @e[type=snowball,tag=fbf.scaffold,nbt={PortalCooldown:2}] \
at @s \
if block ~ ~ ~ #air \
run setblock ~ ~ ~ structure_void
#:Type_3:Chain
#:Desc_3:Replace structure void with air
execute \
as @e[\
type=snowball,\
tag=fbf.scaffold,\
nbt={PortalCooldown:0}\
] \
at @s \
unless entity @e[\
type=snowball,\
tag=fbf.scaffold,\
nbt=!{PortalCooldown:0},\
distance=..0.1] \
if block ~ ~ ~ structure_void \
run setblock ~ ~ ~ air
#:Type_4:Chain
#:Desc_4:Kill snowballs not in structure void
execute \
as @e[type=snowball,tag=fbf.scaffold] \
at @s \
unless block ~ ~ ~ structure_void \
run kill @s
#:Type_5:Repeat
#:Desc_5:Update the item model of item in offhand
execute \
as @a \
if predicate {\
condition:entity_properties,\
entity:this,\
predicate:{\
equipment:{\
offhand:{\
items:oxidized_copper_golem_statue,\
components:{block_state:{copper_golem_pose:"star"}}\
}\
}\
}\
} \
run item modify entity @s weapon.offhand [\
{\
conditions:[{\
condition:entity_properties,\
entity:this,\
predicate:{"type_specific/player":{input:{sneak:true}}}\
}],\
function:set_components,\
components:{item_model:air}\
},{\
conditions:[{\
condition:entity_properties,\
entity:this,\
predicate:{"type_specific/player":{input:{sneak:false}}}\
}],\
function:set_components,\
components:{item_model:oxidized_copper_golem_statue}\
}\
]
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:1
#:Title:Midair Block Placer
#:Type_1:Repeat
#:Desc_1:Summon snowball in center of target block
execute as @a if predicate {condition:entity_properties,entity:this,predicate:{equipment:{offhand:{items:oxidized_copper_golem_statue,components:{block_state:{copper_golem_pose:"star"}}}},"type_specific/player":{input:{sneak:true}}}} at @s rotated as @s anchored eyes positioned ^ ^ ^2.5 align xyz run summon snowball ~0.5 ~0.625 ~0.5 {Tags:[fbf.scaffold],Item:{id:oxidized_copper_golem_statue,components:{block_state:{copper_golem_pose:"star"}}},NoGravity:1b,PortalCooldown:2}
#:Type_2:Chain
#:Desc_2:Replace air with structure void
execute as @e[type=snowball,tag=fbf.scaffold,nbt={PortalCooldown:2}] at @s if block ~ ~ ~ #air run setblock ~ ~ ~ structure_void
#:Type_3:Chain
#:Desc_3:Replace structure void with air
execute as @e[type=snowball,tag=fbf.scaffold,nbt={PortalCooldown:0}] at @s unless entity @e[type=snowball,tag=fbf.scaffold,nbt=!{PortalCooldown:0},distance=..0.1] if block ~ ~ ~ structure_void run setblock ~ ~ ~ air
#:Type_4:Chain
#:Desc_4:Kill snowballs not in structure void
execute as @e[type=snowball,tag=fbf.scaffold] at @s unless block ~ ~ ~ structure_void run kill @s
#:Type_5:Repeat
#:Desc_5:Update the item model of item in offhand
execute as @a if predicate {condition:entity_properties,entity:this,predicate:{equipment:{offhand:{items:oxidized_copper_golem_statue,components:{block_state:{copper_golem_pose:"star"}}}}}} run item modify entity @s weapon.offhand [{conditions:[{condition:entity_properties,entity:this,predicate:{"type_specific/player":{input:{sneak:true}}}}],function:set_components,components:{item_model:air}},{conditions:[{condition:entity_properties,entity:this,predicate:{"type_specific/player":{input:{sneak:false}}}}],function:set_components,components:{item_model:oxidized_copper_golem_statue}}]
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:2
#:Title:Hitomezashi Pattern Generator
#:Type_1:Repeat
#:Desc_1:Summon helpers to either side of main stitcher; Move stitcher forward
execute \
as @e[name=Hitomezashi] \
at @s \
rotated as @s \
if block ~ ~-1 ~ white_concrete \
positioned ^-2 ^ ^ \
summon area_effect_cloud \
store success entity @s data.fbf.hito_new byte 1 \
store success entity @s data.fbf.hito_helper byte 1 \
store success entity @s Radius float 1 \
store success entity @s Duration int 1 \
store success entity @s Age int -1 \
store success entity @s WaitTime int 0 \
positioned ^4 ^ ^ \
summon area_effect_cloud \
store success entity @s data.fbf.hito_new byte 1 \
store success entity @s data.fbf.hito_helper byte 1 \
store success entity @s Radius float 1 \
store success entity @s Duration int 1 \
store success entity @s Age int -1 \
store success entity @s WaitTime int 0 \
positioned ^-2 ^ ^ \
as @n[name=Hitomezashi] \
rotated as @s \
run tp @s ^ ^ ^2
#:Type_2:Chain
#:Desc_2:Rotate helpers to face away from main stitcher
execute \
as @e[name=Hitomezashi] \
at @s \
rotated as @s \
positioned ^ ^ ^-2 \
as @n[nbt={data:{fbf:{hito_new:1b}}},distance=..2.5,limit=2] \
run rotate @s facing ~ ~ ~
#:Type_3:Chain
#:Desc_3:If 50% chance passes, or block is white wool, move new helper forward
execute \
as @e[nbt={data:{fbf:{hito_new:1b}}}] \
at @s \
rotated as @s \
if predicate {\
condition:any_of,\
terms:[\
{\
condition:all_of,\
terms:[\
{\
condition:location_check,\
offsetY:-1,\
predicate:{block:{blocks:[white_concrete,black_concrete]}}\
},\
{\
condition:random_chance,\
chance:0.5\
}\
]\
},\
{\
condition:location_check,\
offsetY:-1,\
predicate:{block:{blocks:white_wool}}\
}\
]\
} \
run tp @s ^ ^ ^-2
#:Type_4:Chain
#:Desc_4:Draw tiles in front of helper; Remove new helper tag; Reset age
execute \
as @e[nbt={data:{fbf:{hito_helper:1b}}}] \
at @s \
rotated as @s \
positioned ~ ~-1 ~ \
store success entity @s data.fbf.hito_new byte 0 \
store result entity @s Age int -1 \
run fill ^ ^ ^ ^ ^ ^-2 black_concrete replace white_concrete
#:Type_5:Chain
#:Desc_5:Move helper forward
execute \
as @e[nbt={data:{fbf:{hito_helper:1b}}}] \
at @s \
rotated as @s \
run tp @s ^ ^ ^-4
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:2
#:Title:Hitomezashi Pattern Generator
#:Type_1:Repeat
#:Desc_1:Summon helpers to either side of main stitcher; Move stitcher forward
execute as @e[name=Hitomezashi] at @s rotated as @s if block ~ ~-1 ~ white_concrete positioned ^-2 ^ ^ summon area_effect_cloud store success entity @s data.fbf.hito_new byte 1 store success entity @s data.fbf.hito_helper byte 1 store success entity @s Radius float 1 store success entity @s Duration int 1 store success entity @s Age int -1 store success entity @s WaitTime int 0 positioned ^4 ^ ^ summon area_effect_cloud store success entity @s data.fbf.hito_new byte 1 store success entity @s data.fbf.hito_helper byte 1 store success entity @s Radius float 1 store success entity @s Duration int 1 store success entity @s Age int -1 store success entity @s WaitTime int 0 positioned ^-2 ^ ^ as @n[name=Hitomezashi] rotated as @s run tp @s ^ ^ ^2
#:Type_2:Chain
#:Desc_2:Rotate helpers to face away from main stitcher
execute as @e[name=Hitomezashi] at @s rotated as @s positioned ^ ^ ^-2 as @n[nbt={data:{fbf:{hito_new:1b}}},distance=..2.5,limit=2] run rotate @s facing ~ ~ ~
#:Type_3:Chain
#:Desc_3:If 50% chance passes, or block is white wool, move new helper forward
execute as @e[nbt={data:{fbf:{hito_new:1b}}}] at @s rotated as @s if predicate {condition:any_of,terms:[{condition:all_of,terms:[{condition:location_check,offsetY:-1,predicate:{block:{blocks:[white_concrete,black_concrete]}}},{condition:random_chance,chance:0.5}]},{condition:location_check,offsetY:-1,predicate:{block:{blocks:white_wool}}}]} run tp @s ^ ^ ^-2
#:Type_4:Chain
#:Desc_4:Draw tiles in front of helper; Remove new helper tag; Reset age
execute as @e[nbt={data:{fbf:{hito_helper:1b}}}] at @s rotated as @s positioned ~ ~-1 ~ store success entity @s data.fbf.hito_new byte 0 store result entity @s Age int -1 run fill ^ ^ ^ ^ ^ ^-2 black_concrete replace white_concrete
#:Type_5:Chain
#:Desc_5:Move helper forward
execute as @e[nbt={data:{fbf:{hito_helper:1b}}}] at @s rotated as @s run tp @s ^ ^ ^-4
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:3
#:Title:Randomized jeb_ Wool
#:Type_1:Repeat
#:Desc_1:Add marker item to jeb_ sheep to identify them after death
execute \
as @e[type=sheep,nbt={Sheared:0b,CustomName:"jeb_"}] \
unless items entity @s armor.body *[custom_data~{"fbf.sheep":1b}] \
run data merge entity @s {\
equipment:{body:{\
id:"mutton",\
components:{\
custom_data:{"fbf.sheep":1b},\
equippable:{slot:body,can_be_sheared:false}\
}\
}},\
drop_chances:{body:1}\
}
#:Type_2:Repeat
#:Desc_2:Modify wool drop from killed jeb_ sheep
execute \
as @e[type=item,nbt={Age:0s}] \
if items entity @s container.0 #minecraft:wool \
at @s \
if entity @e[\
type=item,\
nbt={Item:{components:{"minecraft:custom_data":{"fbf.sheep":1b}}}},\
distance=0..0.1\
] \
run loot replace entity @s container.0 loot {\
pools:[{\
rolls:1,\
entries:[\
{type:item,name:black_wool},\
{type:item,name:blue_wool},\
{type:item,name:brown_wool},\
{type:item,name:cyan_wool},\
{type:item,name:gray_wool},\
{type:item,name:green_wool},\
{type:item,name:light_blue_wool},\
{type:item,name:light_gray_wool},\
{type:item,name:lime_wool},\
{type:item,name:magenta_wool},\
{type:item,name:orange_wool},\
{type:item,name:pink_wool},\
{type:item,name:purple_wool},\
{type:item,name:red_wool},\
{type:item,name:white_wool},\
{type:item,name:yellow_wool}\
]\
}]\
}
#:Type_3:Chain
#:Desc_3:Remove the marker item from the world
kill @e[\
type=item,\
nbt={Item:{components:{"minecraft:custom_data":{"fbf.sheep":1b}}}}\
]
#:Type_4:Repeat
#:Desc_4:Remove marker item from renamed or sheared sheep
execute \
as @e[type=sheep] \
if items entity @s armor.body *[custom_data~{"fbf.sheep":1b}] \
unless entity @s[nbt={Sheared:0b,CustomName:"jeb_"}] \
run item replace entity @s armor.body with air
#:Type_5:Repeat
#:Desc_5:Modify wool drop from shorn jeb_ sheep
execute \
as @e[type=item,nbt={Age:0s}] \
if items entity @s container.0 #minecraft:wool \
at @s \
positioned ~ ~-1.0 ~ \
if entity @e[type=sheep,nbt={CustomName:"jeb_",Sheared:1b},distance=0..0.1] \
run loot replace entity @s container.0 loot {\
pools:[{\
rolls:1,\
entries:[\
{type:item,name:black_wool},\
{type:item,name:blue_wool},\
{type:item,name:brown_wool},\
{type:item,name:cyan_wool},\
{type:item,name:gray_wool},\
{type:item,name:green_wool},\
{type:item,name:light_blue_wool},\
{type:item,name:light_gray_wool},\
{type:item,name:lime_wool},\
{type:item,name:magenta_wool},\
{type:item,name:orange_wool},\
{type:item,name:pink_wool},\
{type:item,name:purple_wool},\
{type:item,name:red_wool},\
{type:item,name:white_wool},\
{type:item,name:yellow_wool}\
]\
}]\
}
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:3
#:Title:Randomized jeb_ Wool
#:Type_1:Repeat
#:Desc_1:Add marker item to jeb_ sheep to identify them after death
execute as @e[type=sheep,nbt={Sheared:0b,CustomName:"jeb_"}] unless items entity @s armor.body *[custom_data~{"fbf.sheep":1b}] run data merge entity @s {equipment:{body:{id:"mutton",components:{custom_data:{"fbf.sheep":1b},equippable:{slot:body,can_be_sheared:false}}}},drop_chances:{body:1}}
#:Type_2:Repeat
#:Desc_2:Modify wool drop from killed jeb_ sheep
execute as @e[type=item,nbt={Age:0s}] if items entity @s container.0 #minecraft:wool at @s if entity @e[type=item,nbt={Item:{components:{"minecraft:custom_data":{"fbf.sheep":1b}}}},distance=0..0.1] run loot replace entity @s container.0 loot {pools:[{rolls:1,entries:[{type:item,name:black_wool},{type:item,name:blue_wool},{type:item,name:brown_wool},{type:item,name:cyan_wool},{type:item,name:gray_wool},{type:item,name:green_wool},{type:item,name:light_blue_wool},{type:item,name:light_gray_wool},{type:item,name:lime_wool},{type:item,name:magenta_wool},{type:item,name:orange_wool},{type:item,name:pink_wool},{type:item,name:purple_wool},{type:item,name:red_wool},{type:item,name:white_wool},{type:item,name:yellow_wool}]}]}
#:Type_3:Chain
#:Desc_3:Remove the marker item from the world
kill @e[type=item,nbt={Item:{components:{"minecraft:custom_data":{"fbf.sheep":1b}}}}]
#:Type_4:Repeat
#:Desc_4:Remove marker item from renamed or sheared sheep
execute as @e[type=sheep] if items entity @s armor.body *[custom_data~{"fbf.sheep":1b}] unless entity @s[nbt={Sheared:0b,CustomName:"jeb_"}] run item replace entity @s armor.body with air
#:Type_5:Repeat
#:Desc_5:Modify wool drop from shorn jeb_ sheep
execute as @e[type=item,nbt={Age:0s}] if items entity @s container.0 #minecraft:wool at @s positioned ~ ~-1.0 ~ if entity @e[type=sheep,nbt={CustomName:"jeb_",Sheared:1b},distance=0..0.1] run loot replace entity @s container.0 loot {pools:[{rolls:1,entries:[{type:item,name:black_wool},{type:item,name:blue_wool},{type:item,name:brown_wool},{type:item,name:cyan_wool},{type:item,name:gray_wool},{type:item,name:green_wool},{type:item,name:light_blue_wool},{type:item,name:light_gray_wool},{type:item,name:lime_wool},{type:item,name:magenta_wool},{type:item,name:orange_wool},{type:item,name:pink_wool},{type:item,name:purple_wool},{type:item,name:red_wool},{type:item,name:white_wool},{type:item,name:yellow_wool}]}]}
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:4
#:Title:Chaos Game Fractals
#:Type_1:Repeat
#:Desc_1:If no plot helper exists, summon one at a random corner
execute \
unless entity @e[type=marker,name=ChaosPainter] \
at @e[type=armor_stand,name=ChaosCorner,sort=random,limit=1] \
run summon marker ~ ~ ~ {CustomName:"ChaosPainter"}
#:Type_2:Repeat
#:Desc_2:Move plot helper and main plotter towards each other
execute \
as @e[name=ChaosPainter] at @s \
facing entity @n[name=ChaosPainter,distance=0.9..] feet \
anchored feet \
run tp @s ^ ^ ^0.3
#:Type_3:Conditional
#:Desc_3:Move main plotter towards helper again if fast enabled
execute \
as @e[name=ChaosPainter] at @s \
if items entity @s armor.legs *[enchantments~[{enchantments:swift_sneak}]] \
facing entity @n[type=marker,name=ChaosPainter] feet \
anchored feet \
run tp @s ^ ^ ^0.3
#:Type_4:Chain
#:Desc_4:If plotters are close enough, paint ground
execute \
as @e[type=armor_stand,name=ChaosPainter] at @s \
if entity @n[type=marker,name=ChaosPainter,distance=..0.901] \
if block ~ ~-1 ~ white_concrete \
run setblock ~ ~-1 ~ black_concrete
#:Type_5:Chain
#:Desc_5:If plotters are close enough, remove the plot helper
execute \
as @e[type=armor_stand,name=ChaosPainter] \
at @s \
run kill @n[type=marker,name=ChaosPainter,distance=..0.901]
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:4
#:Title:Chaos Game Fractals
#:Type_1:Repeat
#:Desc_1:If no plot helper exists, summon one at a random corner
execute unless entity @e[type=marker,name=ChaosPainter] at @e[type=armor_stand,name=ChaosCorner,sort=random,limit=1] run summon marker ~ ~ ~ {CustomName:"ChaosPainter"}
#:Type_2:Repeat
#:Desc_2:Move plot helper and main plotter towards each other
execute as @e[name=ChaosPainter] at @s facing entity @n[name=ChaosPainter,distance=0.5..] feet anchored feet run tp @s ^ ^ ^0.5
#:Type_3:Chain
#:Desc_3:Move main plotter towards helper again if fast enabled
execute as @e[name=ChaosPainter] at @s if items entity @s armor.legs *[enchantments~[{enchantments:swift_sneak}]] facing entity @n[name=ChaosPainter,distance=0.5..] feet anchored feet run tp @s ^ ^ ^0.5
#:Type_4:Repeat
#:Desc_4:If plotters are close enough, paint ground
execute as @e[type=armor_stand,name=ChaosPainter] at @s if entity @n[type=marker,name=ChaosPainter,distance=..0.501] run setblock ~ ~-1 ~ black_concrete
#:Type_5:Chain
#:Desc_5:If plotters are close enough, remove the plot helper
execute as @e[type=armor_stand,name=ChaosPainter] at @s run kill @n[type=marker,name=ChaosPainter,distance=..0.501]
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:5
#:Title:Crafted Display Case
#:Type_1:Repeat
#:Desc_1:Craft the display case
execute \
as @p \
unless items entity @s player.cursor * \
if items entity @s player.crafting.0 glass \
unless items entity @s player.crafting.1 * \
if items entity @s player.crafting.2 stone_pressure_plate \
unless items entity @s player.crafting.3 * \
run loot replace entity @s player.cursor loot {pools:[\
{\
rolls:1,\
entries:[{\
type:item,\
name:salmon_spawn_egg,\
functions:[{\
function:set_components,\
components:{\
item_name:"Display Case",\
item_model:glass,\
enchantment_glint_override:true,\
entity_data:{id:interaction,response:true,Tags:[fbf.display_case]}\
}\
}]\
}]\
},\
{\
rolls:1,\
entries:[{\
type:slots,\
slot_source:{\
type:slot_range,\
slots:"player.crafting.0",\
source:"this"\
},\
functions:[{function:set_count,count:-1,add:true}]\
}]\
},\
{\
rolls:1,\
entries:[{\
type:item,\
name:light_gray_stained_glass_pane,\
functions:[{function:set_count,count:-1,add:true}]\
}]\
},\
{\
rolls:1,\
entries:[{\
type:slots,slot_source:{\
type:slot_range,\
slots:"player.crafting.2",\
source:"this"\
},\
functions:[{function:set_count,count:-1,add:true}]\
}]\
},\
{\
rolls:1,\
entries:[{\
type:item,\
name:light_gray_stained_glass_pane,\
functions:[{function:set_count,count:-1,add:true}]\
}]\
}\
]}
#:Type_2:Repeat
#:Desc_2:Spawn display entities at the location of the new interaction
execute \
as @e[type=interaction,tag=fbf.display_case] \
at @s align xyz \
positioned ~0.5 ~0.0 ~0.5 \
unless entity @e[type=item_display,tag=fbf.display_item,distance=0..0.01] \
run summon item_display ~ ~ ~ {\
Tags:[fbf.display_item],\
billboard:fixed,\
teleport_duration:2,\
transformation:{\
left_rotation:[0,0,0,1],\
right_rotation:[0,0,0,1],\
translation:[0,0.5,0],\
scale:[0.707,0.707,0.707]\
},\
Passengers:[\
{\
id:block_display,\
Tags:[fbf.display_glass],\
block_state:{Name:glass},\
billboard:fixed,\
transformation:{\
left_rotation:[0,0,0,1],\
right_rotation:[0,0,0,1],\
translation:[-0.5,0.0,-0.5],\
scale:[1,1,1]\
}\
},\
{\
id:block_display,\
Tags:[fbf.display_pedestal],\
block_state:{Name:stone_pressure_plate},\
billboard:fixed,\
transformation:{\
left_rotation:[0,0,0,1],\
right_rotation:[0,0,0,1],\
translation:[-0.375,0.0,-0.375],\
scale:[0.75,0.75,0.75]\
}\
},\
{\
id:happy_ghast,\
Tags:[fbf.display_collision],\
NoAI:1b,\
Silent:1b,\
Invulnerable:1b,\
attributes:[{id:scale,base:0.2}],\
active_effects:[{id:invisibility,duration:-1,show_particles:false}]\
}\
]\
}
#:Type_3:Repeat
#:Desc_3:On interact, update the display to match held item
execute \
as @e[type=interaction,tag=fbf.display_case] \
if data entity @s interaction \
at @s align xyz positioned ~0.5 ~0.0 ~0.5 \
store success entity @s interaction byte 0 \
on target \
run item replace \
entity @n[type=item_display,tag=fbf.display_item] container.0 \
from entity @s weapon.mainhand
#:Type_4:Repeat
#:Desc_4:On hit, drop the item display and "kill" entities
execute \
as @e[type=interaction,tag=fbf.display_case] \
if data entity @s attack \
at @s align xyz positioned ~0.5 ~0.0 ~0.5 \
store success entity @s attack byte 0 \
store success entity @s Pos[0] double -2147483647 \
store success entity @s Pos[1] double -2147483647 \
store success entity @s Pos[2] double -2147483647 \
as @n[type=item_display,tag=fbf.display_item] \
store success entity @s Pos[0] double -2147483647 \
store success entity @s Pos[1] double -2147483647 \
store success entity @s Pos[2] double -2147483647 \
as @n[type=block_display,tag=fbf.display_glass] \
store success entity @s Pos[0] double -2147483647 \
store success entity @s Pos[1] double -2147483647 \
store success entity @s Pos[2] double -2147483647 \
as @n[type=block_display,tag=fbf.display_pedestal] \
store success entity @s Pos[0] double -2147483647 \
store success entity @s Pos[1] double -2147483647 \
store success entity @s Pos[2] double -2147483647 \
as @n[type=happy_ghast,tag=fbf.display_collision] \
store success entity @s Pos[1] double -1024 \
run loot spawn ~ ~ ~ loot {\
pools:[{\
rolls:1,\
entries:[{\
type:item,\
name:salmon_spawn_egg,\
functions:[{\
function:set_components,\
components:{\
item_name:"Display Case",\
item_model:glass,\
enchantment_glint_override:true,\
entity_data:{id:interaction,response:true,Tags:[fbf.display_case]}\
}\
}]\
}]\
}]\
}
#:Five Block Friday by DqwertyC
#:Season:2
#:Episode:5
#:Title:Crafted Display Case
#:Type_1:Repeat
#:Desc_1:Craft the display case
execute as @p unless items entity @s player.cursor * if items entity @s player.crafting.0 glass unless items entity @s player.crafting.1 * if items entity @s player.crafting.2 stone_pressure_plate unless items entity @s player.crafting.3 * run loot replace entity @s player.cursor loot {pools:[{rolls:1,entries:[{type:item,name:salmon_spawn_egg,functions:[{function:set_components,components:{item_name:"Display Case",item_model:glass,enchantment_glint_override:true,entity_data:{id:interaction,response:true,Tags:[fbf.display_case]}}}]}]},{rolls:1,entries:[{type:slots,slot_source:{type:slot_range,slots:"player.crafting.0",source:"this"},functions:[{function:set_count,count:-1,add:true}]}]},{rolls:1,entries:[{type:item,name:light_gray_stained_glass_pane,functions:[{function:set_count,count:-1,add:true}]}]},{rolls:1,entries:[{type:slots,slot_source:{type:slot_range,slots:"player.crafting.2",source:"this"},functions:[{function:set_count,count:-1,add:true}]}]},{rolls:1,entries:[{type:item,name:light_gray_stained_glass_pane,functions:[{function:set_count,count:-1,add:true}]}]}]}
#:Type_2:Repeat
#:Desc_2:Spawn display entities at the location of the new interaction
execute as @e[type=interaction,tag=fbf.display_case] at @s align xyz positioned ~0.5 ~0.0 ~0.5 unless entity @e[type=item_display,tag=fbf.display_item,distance=0..0.01] run summon item_display ~ ~ ~ {Tags:[fbf.display_item],billboard:fixed,teleport_duration:2,transformation:{left_rotation:[0,0,0,1],right_rotation:[0,0,0,1],translation:[0,0.5,0],scale:[0.707,0.707,0.707]},Passengers:[{id:block_display,Tags:[fbf.display_glass],block_state:{Name:glass},billboard:fixed,transformation:{left_rotation:[0,0,0,1],right_rotation:[0,0,0,1],translation:[-0.5,0.0,-0.5],scale:[1,1,1]}},{id:block_display,Tags:[fbf.display_pedestal],block_state:{Name:stone_pressure_plate},billboard:fixed,transformation:{left_rotation:[0,0,0,1],right_rotation:[0,0,0,1],translation:[-0.375,0.0,-0.375],scale:[0.75,0.75,0.75]}},{id:happy_ghast,Tags:[fbf.display_collision],NoAI:1b,Silent:1b,Invulnerable:1b,attributes:[{id:scale,base:0.2}],active_effects:[{id:invisibility,duration:-1,show_particles:false}]}]}
#:Type_3:Repeat
#:Desc_3:On interact, update the display to match held item
execute as @e[type=interaction,tag=fbf.display_case] if data entity @s interaction at @s align xyz positioned ~0.5 ~0.0 ~0.5 store success entity @s interaction byte 0 on target run item replace entity @n[type=item_display,tag=fbf.display_item] container.0 from entity @s weapon.mainhand
#:Type_4:Repeat
#:Desc_4:On hit, drop the item display and "kill" entities
execute as @e[type=interaction,tag=fbf.display_case] if data entity @s attack at @s align xyz positioned ~0.5 ~0.0 ~0.5 store success entity @s attack byte 0 store success entity @s Pos[0] double -2147483647 store success entity @s Pos[1] double -2147483647 store success entity @s Pos[2] double -2147483647 as @n[type=item_display,tag=fbf.display_item] store success entity @s Pos[0] double -2147483647 store success entity @s Pos[1] double -2147483647 store success entity @s Pos[2] double -2147483647 as @n[type=block_display,tag=fbf.display_glass] store success entity @s Pos[0] double -2147483647 store success entity @s Pos[1] double -2147483647 store success entity @s Pos[2] double -2147483647 as @n[type=block_display,tag=fbf.display_pedestal] store success entity @s Pos[0] double -2147483647 store success entity @s Pos[1] double -2147483647 store success entity @s Pos[2] double -2147483647 as @n[type=happy_ghast,tag=fbf.display_collision] store success entity @s Pos[1] double -1024 run loot spawn ~ ~ ~ loot {pools:[{rolls:1,entries:[{type:item,name:salmon_spawn_egg,functions:[{function:set_components,components:{item_name:"Display Case",item_model:glass,enchantment_glint_override:true,entity_data:{id:interaction,response:true,Tags:[fbf.display_case]}}}]}]}]}
#:Type_5:Repeat
#:Desc_5:Rotate the item in the display case
execute as @e[type=item_display,tag=fbf.display_item] store result entity @s Rotation[0] float 2 run time query gametime