Itemframes can be destroyed by boats in regions
LadyCailinBot opened this issue ยท 14 comments
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
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.
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.
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.
Anyone interested in this issue - this plugin has helped on our server https://github.com/AztecMC/WGItemFrameBreakFlags
Feel free to fix it and make a pull request.
I did fix it, with a GriefPrevention claim, that stops it.
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
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.
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?
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.
Uhm, this is still a bug! ๐
Players can simply ride a boat into a frame and make it drop. Easy as that.