Skip to content

Commit

Permalink
Undead: Allow Itemframe breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo56958 committed Jan 11, 2025
1 parent 6b2b79d commit 040ee82
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Hanging;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -100,6 +101,7 @@ public void onAttack(@NotNull EntityDamageByEntityEvent event) {

if (!(damager instanceof Player player)) return;
if (event.getEntity() instanceof Player) return;
if (event.getEntity() instanceof Hanging) return; // item frames, paintings, etc.
if (!player.hasPermission(getUsePermission())) return;

final ItemStack helmet = player.getInventory().getHelmet();
Expand Down

0 comments on commit 040ee82

Please sign in to comment.