Skip to content

Add a pattern for the block you're currently holding #2979

Description

@madebyisaacr

The Problem

Typing out block names is tedious. I often run into this problem when replacing copper block variants because their names can get very long (e.g. waxed_weathered_cut_copper_slab).

A Solution

Add a #holding pattern (and #offhand for the off-hand slot) to use the block which is currently selected in the hotbar in WorldEdit commands.

The #holding and #offhand patterns should also support block states. For example, if you have a slab in your selected inventory slot, you could use a pattern like #holding[type=bottom] to specify the block state.

Any block states stored in the selected item would be used by default unless you override them in the pattern.

If the selected item is not a placeable block, the command will log an error.

Alternatives

No response

Anything Else?

As an extension to this, #slot1 - #slot9 patterns could also be added to target blocks in hotbar slots. This would make it easy to pick out a block palette of up to 9 blocks in the creative inventory and immediately use them in WorldEdit commands without needing to type out the name of each block.


If this idea is approved by the WorldEdit team, I'd be happy to contribute the code for this feature myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:invalidThis does not describe a request or bug with WorldEdittype:feature-requestRequest for something new

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions