Unable to cancel Lectern GUI open event via PlayerInteractWithBlockBeforeEvent in ScriptAPI
Partner Rank: 2 - Important
Verification Builds: Stable 1.20.51 & Preview 1.20.60.23
Regression Builds: Unknown/None
Summary: Unable to cancel Lectern GUI open event via PlayerInteractWithBlockBeforeEvent in ScriptAPI
Affects currently Live Content: No
Impact: A core mechanic of our redstone-based game relies on invisible lecterns. Not being able to cancel the GUI open event has an impact on gameplay, and we could not release the feature/product in this state
Repro Steps:
- Download repro world below (which includes the following script)
MCM-1729 - Lectern Cancel Event World Download
world.beforeEvents.playerInteractWithBlock.subscribe(e => {
world.sendMessage(e.block.typeId) // Send event message
e.cancel = true // Cancel open event
})
- Load into the imported world (Beta APIs enabled)
- Attempt to right-click Lectern, notice the GUI opens regardless.
- Right-click a Furnace, Crafting Table or Chest & notice the event is cancelled as expected.
Repro Rate: 100%
Observed Results: Upon right-clicking the Lectern, the pages GUI opens.
Expected Results: Upon right-clicking the Lectern, the pages GUI should not open.
Screenshots/Videos attached: Yes, sent to Greg Walls via Compass.
Notes: None