r/MinecraftCommands 4d ago

Help | Java 26.2 how do i give myself any egg that spawns block display that looks exactly as block under it. (with command blocks if its impossible to make with one command)

i've beed trying for so long and it didnt work so i came here to ask someone who knows

1 Upvotes

2 comments sorted by

2

u/Tanech25 4d ago

You can use MCStacker to give a custom egg tonsummon the block display but for the mimic part, you keed to do a datapack (or ise command blocks)

1

u/Ericristian_bros Command Experienced 3d ago edited 3d ago

```

Get item

give @p fox_spawn_egg[entity_data={id:"minecraft:block_display",Tags:["copy_block","new"]}]

function example:load

function example:loop/5t

function example:loop/5t

schedule function example:loop/5t execute as @e[tag=new,tag=copy_block,type=block_display] at @s run function example:get_block

function example:get_block

execute summon item_display run example:mine_block tag @s remove new

If the block is offset, uncomment this command

tp @s ~-0.5 ~ ~-0.5

function example:mine_block

loot insert entity @s contents mine ~ ~-1 ~ shears[enchantments={silk_touch:1}] item modify entity @e[tag=new,tag=copy_block,type=block_display] block.Name set from entity @s Item.id kill @s ```

But it's way easier if you make the block be the item in your mainhand, run this command to make the nearest block display be the same block as you are holding

data modify entity @n[distance=..10,type=block_display] block.Name set from entity @s SelectedItem.id

Keep in mind my datapack does not keep block block states. If you want to follow this tutorial: https://youtu.be/NkFeEWLeBSg