diff --git a/src/main/java/ac/grim/grimac/events/packets/PacketPlayerDigging.java b/src/main/java/ac/grim/grimac/events/packets/PacketPlayerDigging.java index 8ebb64d236..19f18a228b 100644 --- a/src/main/java/ac/grim/grimac/events/packets/PacketPlayerDigging.java +++ b/src/main/java/ac/grim/grimac/events/packets/PacketPlayerDigging.java @@ -23,6 +23,7 @@ import com.github.retrooper.packetevents.protocol.player.InteractionHand; import com.github.retrooper.packetevents.protocol.world.BlockFace; import com.github.retrooper.packetevents.wrapper.play.client.*; +import org.bukkit.Bukkit; public class PacketPlayerDigging extends PacketListenerAbstract { @@ -103,7 +104,10 @@ public static void handleUseItem(GrimPlayer player, ItemStack item, InteractionH } // The client and server don't agree on trident status because mojang is incompetent at netcode. - if (material == ItemTypes.TRIDENT && (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_13_2) || player.getClientVersion().isOlderThanOrEquals(ClientVersion.V_1_8))) { + if (material == ItemTypes.TRIDENT + && item.getDamageValue() < item.getMaxDamage() - 1 // Player can't use item if it's "about to break" + && (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_13_2) + || player.getClientVersion().isOlderThanOrEquals(ClientVersion.V_1_8))) { player.packetStateData.setSlowedByUsingItem(item.getEnchantmentLevel(EnchantmentTypes.RIPTIDE, PacketEvents.getAPI().getServerManager().getVersion().toClientVersion()) <= 0); player.packetStateData.eatingHand = hand; }