Skip to content

Pitch/Yaw ignored when spawning display entities #9418

@tal5

Description

@tal5

Expected behavior

For pitch and yaw to be used when spawning, as with other entities.

Observed/Actual behavior

When spawning a display entity, pitch and yaw seem to be ignored and always become 0.

Steps/models to reproduce

Location location = player.getEyeLocation();
getLogger().info(location.toString());
Display display = player.getWorld().spawn(location, BlockDisplay.class);
getLogger().info(display.getLocation().toString());
getLogger().info(String.valueOf(display.getLocation().equals(location)));

Running the above code will log the first location with the player's yaw and pitch, then the display's location with 0 yaw and pitch, then show that they're not equal:

[23:44:07 INFO]: [PaperTestPlugin] Location{world=CraftWorld{name=world},x=-108.5082338140295,y=101.99942319657657,z=354.9048698050415,pitch=90.0,yaw=162.454}
[23:44:07 INFO]: [PaperTestPlugin] Location{world=CraftWorld{name=world},x=-108.5082338140295,y=101.99942319657657,z=354.9048698050415,pitch=0.0,yaw=0.0}
[23:44:07 INFO]: [PaperTestPlugin] false

Plugin and Datapack List

> plugins
[23:54:02 INFO]: Server Plugins (1):
[23:54:02 INFO]: Bukkit Plugins:
[23:54:02 INFO]:  - PaperTestPlugin
> datapack list
[23:54:21 INFO]: There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)]
[23:54:21 INFO]: There are no more data packs available

Paper version

> version
[00:00:49 INFO]: Checking version, please wait...
[00:00:50 INFO]: This server is running Paper version git-Paper-56 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 2c9c5e4)
You are running the latest version
Previous version: git-Paper-54 (MC: 1.20.1)

Other

I understand that generally you'd use the built-in transformation and not the base yaw/pitch, but I believe there's still a benefit to fixing this if possible (e.g. custom entity systems with generic logic and whatnot).
Especially seeing as this works fine in vanilla commands: /summon block_display ~ ~ ~ {Rotation:[50F,50F],block_state:{Name:"minecraft:grass_block"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueSimple bug fix or feature which would be a good first PR for someone new to the projectstatus: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.type: bugSomething doesn't work as it was intended to.

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions