EssentialsX

EssentialsX

2M Downloads

Blocking placement of END_PORTAL_FRAME stops eye placement too

CaszGamerMD opened this issue ยท 7 comments

commented

anyway to make it so eye of ender can still be placed into portal frames while also blocking placement of the frames themselves?

commented

Could you use /ess debug and post what permissions are shown in the console when you try putting an eye of ender into the portal frame? I thought that was an interact, not a placement.

commented

so when a player, gliched_turtle, tries to place eye into frame
checking if gliched_turtle has essentials.protect.exemptplacement
same as when player tries to place frame
checking if gliched_turtle has essentials.protect.exemptplacement

commented

it still persists, i can confirm its from essentials, i have:

alert:
    on-placement:
    on-use:
    on-break:
  blacklist:
    placement: END_PORTAL_FRAME
    usage:
    break:
    piston:
    dispenser:

i ran /ess debuga player, gliched_turtle, tries to place eye into frame
checking if gliched_turtle has essentials.protect.exemptplacement
same as when player tries to place frame
checking if gliched_turtle has essentials.protect.exemptplacement

when i have nothing in the above config settings every returns to normal.

i understand you wanted me to reach out for support from the discord but that was pointless.

i just want to prevent placement of the portal frame item, while still retaining the vanilla use of naturally generated portal frames.
im trying to make a crafting item that has a end portal frame as the item itself and prevent players from accidental placement.

commented

Thanks for the additional details. I was able to confirm the bug using that configuration. A key distinction here is that eyes of ender cannot be used at all, for some reason, instead of only being blocked when interacting with an end portal frame.

Video demonstration: https://imgur.com/7VioQZf

[14:55:54 INFO]: Server version: 1.15.2-R0.1-SNAPSHOT git-Paper-192 (MC: 1.15.2)
[14:55:54 INFO]: EssentialsX version: 2.17.2.61
[14:55:54 INFO]: LuckPerms version: 5.0.72
[14:55:54 INFO]: Vault version: 1.7.2-b107
[14:55:54 INFO]: EssentialsXProtect version: 2.17.2.61
[14:55:54 INFO]: EssentialsXChat version: 2.17.2.61
[14:55:54 INFO]: EssentialsXAntiBuild version: 2.17.2.61
[14:55:54 INFO]: EssentialsXSpawn version: 2.17.2.61
commented

If you are still having an issue with this, please try asking in the Essentials channels on the Discord server. It seems like this could more likely be a permission or plugin problem. Perhaps you've already fixed it by now.

commented

Config should work with the essentials.build permission given to players.

commented

Config should work with the essentials.build permission given to players.

@pop4959 That's not what this issue was about.

I can confirm that this is, in fact, a valid issue. When trying to place an eye of ender into an end portal frame, the following checks happen:

  • PlayerInteractEvent:
    • Can the player build anything? (permission essentials.build)
    • Can the player interact while holding an Eye of Ender? (blacklist interact and permission essentials.build.interact.ENDER_EYE)
    • Can the player interact with an End Portal Frame? (blacklist interact and permission essentials.build.interact.END_PORTAL_FRAME)
  • BlockPlaceEvent:
    • Can the player build anything? (permission essentials.build)
    • Can the player place an End Portal Frame? (blacklist placement and permission essentials.build.place.END_PORTAL_FRAME)

This final step is the problem - Bukkit fires a BlockPlaceEvent when the eye of ender is inserted, and so AntiBuild assume that the player is trying to place an end portal frame. The only way around this for users is to allow players to place end portal frames.


We could, in theory, add a special case where if the player just attempted to interact with an end portal frame while holding an eye of ender, the following placement check is ignored (or even a temporary permission could be granted). This is an edge case, but it's probably on the more common side of edge cases than some, so this might be a valid solution.