Skip to content

BlockState#copy() does not infer block entity #11700

@YouHaveTrouble

Description

@YouHaveTrouble

Expected behavior

BlockState copy = blockState.copy(location);
copy.update(true, true)

This should set the block type and copy over all block entity data like inventories, bee data, etc.

Observed/Actual behavior

Snippet above only properly sets the block type and does not copy over the block entity data. Throws following warning Skipping BlockEntity with id.

Steps/models to reproduce

Run this snippet with any valid input as blockState and location

BlockState copy = blockState.copy(location);
copy.update(true, true)

Plugin and Datapack List

Issue occurs with only the plugin I'm testing with

Server Plugins (1):
Paper Plugins:
BlockEdit

Datapacks:
There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
There are no more data packs available

Paper version

This server is running Paper version 1.21.3-77-master@1e035f3 (2024-12-01T15:52:35Z) (Implementing API version 1.21.3-R0.1-SNAPSHOT)

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.version: 1.21.3Game version 1.21.3

    Type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions