Skip to content

event.setCancelled() in ShulkerOpenCloseListener#OnShulkerOpen should be changed #5

Description

@Sh1roCu

event.setCancelled(this._openShulker.GetShulkerActions().AttemptToOpenShulkerBox(event.getPlayer()));

If a player that has no itemstack in hand right-click a container(e.g. shulkerbox, barrel, chest and more) while sneaking, the container will could be opened although the block of this container was protected by some plugins like Residence, WorldGuard. It was caused by event.setCancelled(false) because thatthis._openShulker.GetShulkerActions().AttemptToOpenShulkerBox(event.getPlayer())return false.

Should be replaced by
if (this._openShulker.GetShulkerActions().AttemptToOpenShulkerBox(event.getPlayer())) event.setCancelled(true);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions