mojira.dev
MC-259816

Odd behavior when an item_display, block_display, or text_display entity mounts another entity

When an item_display, block_display, or text_display entity mounts another entity, it does not change its position. Instead, it visually behaves as if it's not mounted.

How to reproduce:

Run the following commands in order.

summon minecraft:item_display ~ ~ ~ {item:{id:"minecraft:stick",Count:1b},billboard:"center",Tags:["test_passenger"]}
summon minecraft:pig ~1 ~ ~ {Tags:["test_vehicle"]}
ride @e[type=minecraft:item_display,tag=test_passenger,limit=1] mount @e[type=minecraft:pig,tag=test_vehicle,limit=1]

Observe how the item_display entity, which looks like a stick that is always facing the screen, does not follow the summoned pig's position.

According to the game, the item_display entity is riding the pig. This can be shown with the command

execute as @e[type=minecraft:pig,tag=test_vehicle,limit=1] on passengers run say hi

which outputs the message "[Item Display] hi" in chat.

 

The expected behavior would be for the display entity to either mount the other entity as normal and follow its position, or for an error message to appear when attempting to make the display entity ride another entity.

Linked issues

Comments 5

There seems to be a desync: when you reload the game, the display entity is shown at the pig's position again. I don't think display entities should be able to ride other entities.

I can confirm this, and I have a couple things to add: if a display entity isn't riding anything, you can use /tp on it just fine (its position updates immediately). However, if it's riding an entity, not only does it not follow that entity, it also behaves weirdly when you try to teleport it - if you teleport it to an entity (like yourself) it will update its rotation to match the new position, but it will stay in the same spot. Then, when you force it to dismount using /ride, it will immediately snap to the position you told it to teleport to previously.

I was super bummed out about this bc I thought it would be awesome for display entities to ride mobs, like an icon floating above that mob or something

It doesn't appear to be a desync: The Player has the wrong position serverside as well. I tested this by mounting myself on a Block Entity and running execute at @s run summon minecraft:bee ~ ~ ~ {NoAI:1b} in chat. The bee appeared right where I was sitting.

The cause is actually because display entities are not ticked at all, even passenger logic.

This means the position of the display is not updated, but is saved and loaded correctly (which is why relogging fixes it temporarily)

It also means any passengers of a display entity are also not ticked (which is the root cause of MC-259805 too).

 

I think the best solution would to still remove most of the entity ticking, but still allow the riding and passenger tick logic to run.

This also happens with markers which is even weirder since markers riding entities worked perfectly before this snapshot.

Ellivers

boq

Confirmed

Platform

Normal

Commands, Networking

23w06a

23w07a

Retrieved