The residence area will be attacked by fishing rods
3154311518 opened this issue ยท 6 comments
Please follow the issue template. I need a copy of your config.yml
to know what is going on. Enabling useEntityDamageEvent: true
under old-fishing-knockback
should help with this.
Please follow the issue template. I need a copy of your
config.yml
to know what is going on. EnablinguseEntityDamageEvent: true
underold-fishing-knockback
should help with this.
I set useEntityDamageEvent to true, but I still take damage as before.
Alright. Can you outline what is happening in the video? I presume you are using the Residence plugin.
- Which of the players belong to the residence and which doesn't?
- What do you expect to happen instead of what happens in the video?
I experienced the same problem using the GriefPrevention plugin, if the player is in a protected area the event of grabbing the player with a fishing rod is cancelled but BukkitOldCombatMechanics does not respect the event cancellation.
This makes it possible to pull players offline from their protected areas and then kill and steal their items.
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
public void onPlayerFish(PlayerFishEvent event)
{
Entity entity = event.getCaught();
if (entity == null) return; //if nothing pulled, uninteresting event
//if should be protected from pulling in land claims without permission
if (entity.getType() == EntityType.ARMOR_STAND || entity instanceof Animals)
{
Player player = event.getPlayer();
PlayerData playerData = instance.dataStore.getPlayerData(player.getUniqueId());
Claim claim = instance.dataStore.getClaimAt(entity.getLocation(), false, playerData.lastClaim);
if (claim != null)
{
//if no permission, cancel
Supplier<String> errorMessage = claim.checkPermission(player, ClaimPermission.Inventory, event);
if (errorMessage != null)
{
event.setCancelled(true);
GriefPrevention.sendMessage(player, TextMode.Err, Messages.NoDamageClaimedEntity, claim.getOwnerName());
return;
}
}
}
}
Residence and others protection plugins probably have some similar listener..