Skip to content

Exploit: Copying Buildings with Containers Retains Item Data #761

@sion1021

Description

@sion1021

Is there an existing issue for this?

  • I have searched the existing issues.

Are you using the latest Structurize Version?

  • I am running the latest beta/release version of Structurize for my Minecraft version.
    I am also running the latest versions of other mods that are part of my problem.

Did you check on the Wiki? or ask on Discord?

  • I checked the MineColonies/Structurize Wiki or I asked on discord.

Minecraft Version

1.21

Structurize Version

minecolonies-1.1.990-1.21.1-snapshot

MineColonies Version (if related bug)

minecolonies-1.1.990-1.21.1-snapshot

Related Mods and their Versions

minecolonies-1.1.990-1.21.1-snapshot.jar
stylecolonies-1.14-1.21.1
Byzantine-1.21.1-33
structurize-1.0.775-1.21.1-snapshot
domum-ornamentum-1.0.213-snapshot-main
blockui-1.0.199-1.21.1-snapshot
toms_storage-1.21-2.2.0

Current Behavior

When duplicating buildings containing container blocks using MineColonies blueprints, the NBT data inside those containers is preserved. This allows players to duplicate items inside containers, and even import rare or restricted items from single-player mode via blueprints.

Expected Behavior

When duplicating buildings via blueprints, all NBT data inside container blocks should be cleared, so containers should be empty in the copied building.

Reproduction Steps

  1. In single-player creative mode, run the following command:
    /give @p minecraft:redstone_block{BlockEntityTag:{Items:[{Slot:0b,id:"minecraft:command_block",Count:1b}]}}
  2. Use this redstone block in a MineColonies blueprint.
  3. Import the blueprint to a server or another world.
  4. Retrieve the redstone block from the blueprint.
  5. Destroy the block using fire to get the contained command block.

Logs

No relevant logs. This is a game mechanic exploit.

Anything else?

Hello, thank you very much for creating the MineColonies mod and for all your hard work in developing and maintaining it. I truly appreciate your efforts.

While playing recently, I discovered a potential issue related to the building blueprint system involving container blocks. I’d like to report it for your review and consideration.

Details:
In Minecraft, container-type blocks (such as chests, hoppers, command blocks, etc.) store their item data within their own NBT data. However, when MineColonies’ blueprint system copies buildings, it only checks the block type and state, without verifying or clearing the NBT data inside these containers. As a result, players can duplicate items stored inside these container blocks by duplicating the buildings that contain them.

More seriously, I found that this method can also be used to import rare or restricted items from single-player mode into a multiplayer server via blueprints. For example:

In single-player creative mode, use the command:

/give @p minecraft:redstone_block{BlockEntityTag:{Items:[{Slot:0b,id:"minecraft:command_block",Count:1b}]}}
to create a redstone block containing a command block.

Save this redstone block into a blueprint.

Import the blueprint into a multiplayer server.

Take out the redstone block from the blueprint and break it with fire without placing it, and the contained items can be obtained.

This can disrupt the server's item rarity and game balance.

Suggested solutions:

Review the blueprint system’s mechanism for validating and handling NBT data in container blocks.

Or, when copying a building, automatically clear all NBT data from container blocks (such as chests, hoppers, command blocks, etc.) to ensure they are empty when duplicated.

If needed, I’d be happy to help reproduce this issue for testing and debugging purposes.

Thank you again for your outstanding mod development work!

Footer


Viewers

  • Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
  • Add a comment if you have any insights or background information that isn't already part of the conversation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions