mojira.dev
MCPE-238519

ItemStack only triggers afterEvents.itemUse when placing a block with quantity > 1

When placing a block in the world, world.afterEvents.itemUse event only happens when the ItemStack quantity is 2 or more.

This is a nuisance inconsistency affecting valid use cases.

world.afterEvents.playerPlaceBlock event will fire every time but certain information is only available on the ItemStack (like .itemName) before the block is placed.

Scenarios

Scenario 1: multi-item behavior (expected behavior)

  1. Player active slot is a stack of named minecraft:chest items

  2. Player places (uses) one minecraft:chest item on a valid open location

  3. world.afterEvents.itemUse event fires, allowing examination in script of the itemStack properties

  4. world.afterEvents.playerPlaceBlock event fires, allowing interaction via script with the new block

Scenario 2: single-item behavior

  1. Player active slot is a single named minecraft:chest item

  2. Player places (uses) one minecraft:chest item on a valid open location

  3. world.afterEvents.itemUse does not fire

  4. world.afterEvents.playerPlaceBlock event fires, allowing interaction via script with the new block, but knowledge of the properties of the itemStack used to place the block is not available

Workaround

Store information about the current itemStack in the player’s active hotbar slot every tick just in case they place the block so we can map it all together.

Comments 0

No comments.

TheWorldFoundry

(Unassigned)

Unconfirmed

Multiple

Windows 11

26.13

Retrieved