$execute positioned ~$(x) ~$(y) ~$(z) if block ~ ~ ~ air run summon item ~ ~ ~ {Age:5400,Glowing:1b,Tags:["lucky_block_drop","new"],Item:{id:"minecraft:player_head",count:1,components:{"minecraft:max_stack_size":4,"minecraft:item_name":{"text":"Lucky Block"},"minecraft:lore":[[{"color":"gray","italic":false,"text":"Use "},{"color":"white","italic":false,"keybind":"key.use"},{"color":"gray","italic":false,"text":" to open!"}],{"color":"gray","italic":false,"text":"I wonder what's inside..."}],"minecraft:hide_additional_tooltip":{},"minecraft:custom_data":{lucky_block:1b,default:1b},"minecraft:food":{nutrition:0,saturation:0,can_always_eat:true},"minecraft:consumable":{consume_seconds:1000001,has_consume_particles:false},"minecraft:profile":{id:[I;-2087206888,1259293576,-1271610310,-1658403980],properties:[{name:"textures",value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTBhNDQzZTBlY2E3ZjVkMzA2MjJkZDkzN2YxZTVlYTJjZGYxNWQxMGMyN2ExOTljNjhhN2NlMDljMzlmNmI2OSJ9fX0="}]}}}}
execute as @e[type=item,tag=!lucky_block_item,tag=lucky_block_drop,tag=new] run team join lucky_block
tag @e[tag=new] remove new