mojira.dev
MC-124314

setblock replace gives an unexpected error

The Issue can be recreated when you type this in chat:

/setblock ~ ~ ~1 minecraft:hopper{CustomName:"Blast Furnace Output"} replace

It doesn't matter if another container (dropper with contents) is going to be replaced, or if there's just air, the Error-Message is always as follows:

An unexpected error occurred while executing that command

I only stumbled across this issue when I tried to update a function of mine, a Blast Furnace Function. I don't know if it's totally relevant, but I figured I link this just in case. So, basically, there are two problems occuring:

  • The hopper is supposed to replace a dropper without it dropping its contents. That's what the "replace" functionality is for. The contents dropped anyway.

  • And the hopper wasn't named.

There is different behaviour wether the commands are being run from the functions or from typing in chat. The dropping of contents doesn't occur if the player is execting the setblock command from chat.

Linked issues

Comments 1

CustomName is the problem, not replace; CustomName needs to be valid json. For example:

CustomName:"{\"text\":\"Your Name\"}"

Elemend

(Unassigned)

Unconfirmed

datapack, function, functions, setblock

Minecraft 18w02a

Retrieved