--- a/net/minecraft/world/item/TridentItem.java
+++ b/net/minecraft/world/item/TridentItem.java
@@ -1,6 +1,7 @@
 package net.minecraft.world.item;
 
 import com.google.common.collect.ImmutableMultimap;
+import com.google.common.collect.ImmutableMultimap.Builder;
 import com.google.common.collect.Multimap;
 import net.minecraft.core.BlockPos;
 import net.minecraft.sounds.SoundEvent;
@@ -10,6 +11,7 @@
 import net.minecraft.util.Mth;
 import net.minecraft.world.InteractionHand;
 import net.minecraft.world.InteractionResultHolder;
+import net.minecraft.world.entity.Entity;
 import net.minecraft.world.entity.EquipmentSlot;
 import net.minecraft.world.entity.LivingEntity;
 import net.minecraft.world.entity.MoverType;
@@ -25,6 +27,7 @@
 import net.minecraft.world.phys.Vec3;
 
 public class TridentItem extends Item implements Vanishable {
+
     public static final int THROW_THRESHOLD_TIME = 10;
     public static final float BASE_DAMAGE = 8.0F;
     public static final float SHOOT_POWER = 2.5F;
@@ -32,9 +35,10 @@
 
     public TridentItem(Item.Properties settings) {
         super(settings);
-        ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder();
-        builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Tool modifier", 8.0D, AttributeModifier.Operation.ADDITION));
-        builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Tool modifier", (double)-2.9F, AttributeModifier.Operation.ADDITION));
+        Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder();
+
+        builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(TridentItem.BASE_ATTACK_DAMAGE_UUID, "Tool modifier", 8.0D, AttributeModifier.Operation.ADDITION));
+        builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(TridentItem.BASE_ATTACK_SPEED_UUID, "Tool modifier", -2.9000000953674316D, AttributeModifier.Operation.ADDITION));
         this.defaultModifiers = builder.build();
     }
 
@@ -55,59 +59,92 @@
 
     @Override
     public void releaseUsing(ItemStack stack, Level world, LivingEntity user, int remainingUseTicks) {
-        if (user instanceof Player player) {
-            int i = this.getUseDuration(stack) - remainingUseTicks;
-            if (i >= 10) {
-                int j = EnchantmentHelper.getRiptide(stack);
-                if (j <= 0 || player.isInWaterOrRain()) {
+        if (user instanceof Player) {
+            Player entityhuman = (Player) user;
+            int j = this.getUseDuration(stack) - remainingUseTicks;
+
+            if (j >= 10) {
+                int k = EnchantmentHelper.getRiptide(stack);
+
+                if (k <= 0 || entityhuman.isInWaterOrRain()) {
                     if (!world.isClientSide) {
-                        stack.hurtAndBreak(1, player, (p) -> {
-                            p.broadcastBreakEvent(user.getUsedItemHand());
+                        // CraftBukkit - moved down
+                        /*
+                        itemstack.hurtAndBreak(1, entityhuman, (entityhuman1) -> {
+                            entityhuman1.broadcastBreakEvent(entityliving.getUsedItemHand());
                         });
-                        if (j == 0) {
-                            ThrownTrident thrownTrident = new ThrownTrident(world, player, stack);
-                            thrownTrident.shootFromRotation(player, player.getXRot(), player.getYRot(), 0.0F, 2.5F + (float)j * 0.5F, 1.0F);
-                            if (player.getAbilities().instabuild) {
-                                thrownTrident.pickup = AbstractArrow.Pickup.CREATIVE_ONLY;
+                        */
+                        if (k == 0) {
+                            ThrownTrident entitythrowntrident = new ThrownTrident(world, entityhuman, stack);
+
+                            entitythrowntrident.shootFromRotation(entityhuman, entityhuman.getXRot(), entityhuman.getYRot(), 0.0F, 2.5F + (float) k * 0.5F, 1.0F);
+                            if (entityhuman.getAbilities().instabuild) {
+                                entitythrowntrident.pickup = AbstractArrow.Pickup.CREATIVE_ONLY;
                             }
 
-                            world.addFreshEntity(thrownTrident);
-                            world.playSound((Player)null, thrownTrident, SoundEvents.TRIDENT_THROW, SoundSource.PLAYERS, 1.0F, 1.0F);
-                            if (!player.getAbilities().instabuild) {
-                                player.getInventory().removeItem(stack);
+                            // CraftBukkit start
+                            if (!world.addFreshEntity(entitythrowntrident)) {
+                                if (entityhuman instanceof net.minecraft.server.level.ServerPlayer) {
+                                    ((net.minecraft.server.level.ServerPlayer) entityhuman).getBukkitEntity().updateInventory();
+                                }
+                                return;
+                            }
+
+                            stack.hurtAndBreak(1, entityhuman, (entityhuman1) -> {
+                                entityhuman1.broadcastBreakEvent(user.getUsedItemHand());
+                            });
+                            entitythrowntrident.tridentItem = stack.copy(); // SPIGOT-4511 update since damage call moved
+                            // CraftBukkit end
+
+                            world.playSound((Player) null, (Entity) entitythrowntrident, SoundEvents.TRIDENT_THROW, SoundSource.PLAYERS, 1.0F, 1.0F);
+                            if (!entityhuman.getAbilities().instabuild) {
+                                entityhuman.getInventory().removeItem(stack);
                             }
+                            // CraftBukkit start - SPIGOT-5458 also need in this branch :(
+                        } else {
+                            stack.hurtAndBreak(1, entityhuman, (entityhuman1) -> {
+                                entityhuman1.broadcastBreakEvent(user.getUsedItemHand());
+                            });
+                            // CraftBukkkit end
                         }
                     }
 
-                    player.awardStat(Stats.ITEM_USED.get(this));
-                    if (j > 0) {
-                        float f = player.getYRot();
-                        float g = player.getXRot();
-                        float h = -Mth.sin(f * ((float)Math.PI / 180F)) * Mth.cos(g * ((float)Math.PI / 180F));
-                        float k = -Mth.sin(g * ((float)Math.PI / 180F));
-                        float l = Mth.cos(f * ((float)Math.PI / 180F)) * Mth.cos(g * ((float)Math.PI / 180F));
-                        float m = Mth.sqrt(h * h + k * k + l * l);
-                        float n = 3.0F * ((1.0F + (float)j) / 4.0F);
-                        h *= n / m;
-                        k *= n / m;
-                        l *= n / m;
-                        player.push((double)h, (double)k, (double)l);
-                        player.startAutoSpinAttack(20);
-                        if (player.isOnGround()) {
-                            float o = 1.1999999F;
-                            player.move(MoverType.SELF, new Vec3(0.0D, (double)1.1999999F, 0.0D));
+                    entityhuman.awardStat(Stats.ITEM_USED.get(this));
+                    if (k > 0) {
+                        // CraftBukkit start
+                        org.bukkit.event.player.PlayerRiptideEvent event = new org.bukkit.event.player.PlayerRiptideEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.v1_19_R1.inventory.CraftItemStack.asCraftMirror(stack));
+                        event.getPlayer().getServer().getPluginManager().callEvent(event);
+                        // CraftBukkit end
+                        float f = entityhuman.getYRot();
+                        float f1 = entityhuman.getXRot();
+                        float f2 = -Mth.sin(f * 0.017453292F) * Mth.cos(f1 * 0.017453292F);
+                        float f3 = -Mth.sin(f1 * 0.017453292F);
+                        float f4 = Mth.cos(f * 0.017453292F) * Mth.cos(f1 * 0.017453292F);
+                        float f5 = Mth.sqrt(f2 * f2 + f3 * f3 + f4 * f4);
+                        float f6 = 3.0F * ((1.0F + (float) k) / 4.0F);
+
+                        f2 *= f6 / f5;
+                        f3 *= f6 / f5;
+                        f4 *= f6 / f5;
+                        entityhuman.push((double) f2, (double) f3, (double) f4);
+                        entityhuman.startAutoSpinAttack(20);
+                        if (entityhuman.isOnGround()) {
+                            float f7 = 1.1999999F;
+
+                            entityhuman.move(MoverType.SELF, new Vec3(0.0D, 1.1999999284744263D, 0.0D));
                         }
 
-                        SoundEvent soundEvent;
-                        if (j >= 3) {
-                            soundEvent = SoundEvents.TRIDENT_RIPTIDE_3;
-                        } else if (j == 2) {
-                            soundEvent = SoundEvents.TRIDENT_RIPTIDE_2;
+                        SoundEvent soundeffect;
+
+                        if (k >= 3) {
+                            soundeffect = SoundEvents.TRIDENT_RIPTIDE_3;
+                        } else if (k == 2) {
+                            soundeffect = SoundEvents.TRIDENT_RIPTIDE_2;
                         } else {
-                            soundEvent = SoundEvents.TRIDENT_RIPTIDE_1;
+                            soundeffect = SoundEvents.TRIDENT_RIPTIDE_1;
                         }
 
-                        world.playSound((Player)null, player, soundEvent, SoundSource.PLAYERS, 1.0F, 1.0F);
+                        world.playSound((Player) null, (Entity) entityhuman, soundeffect, SoundSource.PLAYERS, 1.0F, 1.0F);
                     }
 
                 }
@@ -117,30 +154,31 @@
 
     @Override
     public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
-        ItemStack itemStack = user.getItemInHand(hand);
-        if (itemStack.getDamageValue() >= itemStack.getMaxDamage() - 1) {
-            return InteractionResultHolder.fail(itemStack);
-        } else if (EnchantmentHelper.getRiptide(itemStack) > 0 && !user.isInWaterOrRain()) {
-            return InteractionResultHolder.fail(itemStack);
+        ItemStack itemstack = user.getItemInHand(hand);
+
+        if (itemstack.getDamageValue() >= itemstack.getMaxDamage() - 1) {
+            return InteractionResultHolder.fail(itemstack);
+        } else if (EnchantmentHelper.getRiptide(itemstack) > 0 && !user.isInWaterOrRain()) {
+            return InteractionResultHolder.fail(itemstack);
         } else {
             user.startUsingItem(hand);
-            return InteractionResultHolder.consume(itemStack);
+            return InteractionResultHolder.consume(itemstack);
         }
     }
 
     @Override
     public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) {
-        stack.hurtAndBreak(1, attacker, (e) -> {
-            e.broadcastBreakEvent(EquipmentSlot.MAINHAND);
+        stack.hurtAndBreak(1, attacker, (entityliving2) -> {
+            entityliving2.broadcastBreakEvent(EquipmentSlot.MAINHAND);
         });
         return true;
     }
 
     @Override
     public boolean mineBlock(ItemStack stack, Level world, BlockState state, BlockPos pos, LivingEntity miner) {
-        if ((double)state.getDestroySpeed(world, pos) != 0.0D) {
-            stack.hurtAndBreak(2, miner, (e) -> {
-                e.broadcastBreakEvent(EquipmentSlot.MAINHAND);
+        if ((double) state.getDestroySpeed(world, pos) != 0.0D) {
+            stack.hurtAndBreak(2, miner, (entityliving1) -> {
+                entityliving1.broadcastBreakEvent(EquipmentSlot.MAINHAND);
             });
         }
 
