mojira.dev
MCPE-187400

playerInteractWithBlock event doesn't detect when you rotate an item within an item frame

Summary:
The playerInteractWithBlock event doesn't detect if you rotate an item within an item frame.

Code Sample:

import { world } from "@minecraft/server";

world.beforeEvents.playerInteractWithBlock.subscribe((ev) => {
    const block = ev.block;
    if (block.typeId.includes === "frame" && !block.typeId.includes === "end_") {
        ev.cancel = true;
    }
})

Steps to Reproduce:

  1. Import the attached pack and apply it in your world

  2. Place an item frame and put an item in it

  3. Rotate the item

Expected Results:
The rotation is canceled

Observed Results:
The item is rotated

Attachments

Comments 8

I believe you should mention the namespace "minecraft:" in the ids, for example: "minecraft:frame"

I believe you should mention the namespace "minecraft:" in the ids, for example: "minecraft:frame"

Does it work if you use the minecraft namespace as mentioned in the previous comment?

Does it work if you use the minecraft namespace as mentioned in the previous comment?

I fixed my code, I think it should work the same as when I added the namespace

Resolving as Cannot Reproduce since the issue was the missing namespace in the code.

You can use the feedback site to request allowing it to work without the namespace.

Resolving as Cannot Reproduce since the issue was the missing namespace in the code.

You can use the feedback site to request allowing it to work without the namespace.

Hangekisobu

(Unassigned)

Unconfirmed

Windows

item-frame, scripting-api

1.21.31 Hotfix

Retrieved