mojira.dev
MC-313270

New Dispenser Placement behaviors with datapacks not taking block_entity_data into account

Issue:
Hello, I was testing the new Dispenser feature using a datapack to make the dispenser place blocks mainly the Command Block.
What is seems like is when you give the command block item a component of “minecraft:dispense_behavior“ it fails to use the block_entity_data inside the block such as the baked in command or settings

Reproducing:
Create a datapack make sure your pack.mcmeta is setup correctly with version 128

{
	"pack": {
		"min_format": 128,
		"max_format": 128,
		"description": [
			{
				"text": "[",
				"color": "gold"
			},
			{
				"text": "Custom Additions",
				"color": "green",
				"bold": true,
				"underlined": true
			},
			{
				"text": "]",
				"color": "gold"
			}
		]
	}
}

Inside that datapack make a folder inside of your namespace called dispense_behavior with a .json file in it… Mine is called

“place_this_block.json“

[
    {
        "type":"place_block"
    }
]


Now that you have your datapack setup we now need to give ourselves a command block with the component to be able to place it via the dispenser

Command: /give @s command_block[dispense_behavior="ca:place_this_block",block_entity_data={id:"command_block",auto:1,Command:"/say Hello, World!"}]

Now if you place down this block you can see that the block plays the command you gave it
[@] Hello, World!

Now place that command block in a dispenser and power it… as you can see the block is successfully place YIPPPEEEEEE But also if you open the block there is no data and the block didn’t play its command

What should happen:
The command block should use all the block entity tag data available in the block item

-See Vid in Attachments-

Also for some reason I was unable to embed the pictures and vids in the bug report so I externally attached them

Environment

Java Edition 26.4 Snapshot 10

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media][media][media]

ArsiTheFox

(Unassigned)

Unconfirmed

26.4 Snapshot 10

Retrieved