WorldGuard

WorldGuard

8M Downloads

Itemframes can be destroyed by boats in regions

LadyCailinBot opened this issue ยท 14 comments

commented

WORLDGUARD-3934 - Reported by Bedah

Hey,
placing a boat and driving against an itemframe in a region, leaves a frame after some time fall off.
Some options to block that without prohibiting boats?

WG: 6.2.2
Spigot: 1.12.2

Best Regards

commented

Kinda sad this exploit is still in the plugin almost 4 years later :S (and that I only now hear about it...)

Would probably be good to either push for an entity collide event finally getting added, make this particular type of destruction call the EntityBreakHangingEvent or (as a workaround) stop breaking of item frames from the physics when a boat is nearby.

commented

I feel like it would be better to have a couple of false positive entity destruction blocked inside a protected region in general for the sake of not having possible griefing exploits. Of course the plugin API needs improvement there.

commented

as far as I can tell, a wide variety of entities can trigger this. there is no way for us to do anything about this short of cancelling all physics-caused hangingbreak events, which is tbh stupid. feel free to PR to spigot a more correct behavior like HangingBreakByEntityEvent.

commented

4 years!? I had players exploiting this today.

commented

Feel free to fix it and make a pull request.

commented

Anyone interested in this issue - this plugin has helped on our server https://github.com/AztecMC/WGItemFrameBreakFlags

commented

Feel free to fix it and make a pull request.

I did fix it, with a GriefPrevention claim, that stops it.

commented

there is a flag, entity-item-frame-destroy, that seems to stop this, but does not work on minecraft 1.17 and worldguard 7.0.6. it does seem to work on 7.0.7 and 1.18

commented

that would imply something has changed upstream, since (as noted 4 years ago at the top of this comment chain) there hasn't been any entity associated with this sort of breaking previously. however the spigot bug (https://hub.spigotmc.org/jira/browse/SPIGOT-3999) is still open so i'm unsure that's really the case.

commented

I fix this with something like this and it works for me for a year already:

@EventHandler
    public void onItemFrameDestroy(HangingBreakEvent event) {
        if (!(event.getEntity() instanceof ItemFrame itemFrame)) {
            return;
        }
        if (event.getCause() != HangingBreakEvent.RemoveCause.PHYSICS) {
            return;
        }
        var block = itemFrame.getLocation().getBlock().getRelative(itemFrame.getAttachedFace());
        if (!block.getType().isSolid()) {
            return;
        }
        event.setCancelled(true);
    }

Can this be probably added behind a config option so people can protect their servers?

commented
commented

Comment by PseudoKnight

What unusual behavior. Looks like it's a PHYSICS cause. There's no perfect way of preventing exploitation of this since there's no associated player if they're not in the boat. There are some reasonable partial solutions, though, as well as some blanket blocking options. These would need to be added.

commented

Uhm, this is still a bug! ๐Ÿ˜„
Players can simply ride a boat into a frame and make it drop. Easy as that.

https://cdn.discordapp.com/attachments/470410381597343753/851615802293747722/Minecraft_1.16.5_-_Multiplayer_3rd-party_Server_2021-06-08_02-15-32_Trim.mp4

commented

Hello, any updates on this issue? One of our players was able to drive boat into other players regions causing havoc to their stashes.