Closed 3154311518 closed 1 year ago
server: paper1.12.2 OldCombatMechanics 1.11.0
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.
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..
The residence area will be attacked by fishing rods
https://user-images.githubusercontent.com/46740577/234429590-4b81b4fb-b949-46c8-8d34-c0d97f9375df.mp4