--- a/net/minecraft/world/item/TridentItem.java
+++ b/net/minecraft/world/item/TridentItem.java
@@ -11,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.EquipmentSlotGroup;
 import net.minecraft.world.entity.LivingEntity;
@@ -29,6 +30,7 @@
 import net.minecraft.world.phys.Vec3;
 
 public class TridentItem extends Item implements ProjectileItem {
+
     public static final int THROW_THRESHOLD_TIME = 10;
     public static final float BASE_DAMAGE = 8.0F;
     public static final float SHOOT_POWER = 2.5F;
@@ -38,18 +40,7 @@
     }
 
     public static ItemAttributeModifiers createAttributes() {
-        return ItemAttributeModifiers.builder()
-            .add(
-                Attributes.ATTACK_DAMAGE,
-                new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Tool modifier", 8.0, AttributeModifier.Operation.ADD_VALUE),
-                EquipmentSlotGroup.MAINHAND
-            )
-            .add(
-                Attributes.ATTACK_SPEED,
-                new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Tool modifier", -2.9F, AttributeModifier.Operation.ADD_VALUE),
-                EquipmentSlotGroup.MAINHAND
-            )
-            .build();
+        return ItemAttributeModifiers.builder().add(Attributes.ATTACK_DAMAGE, new AttributeModifier(TridentItem.BASE_ATTACK_DAMAGE_UUID, "Tool modifier", 8.0D, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND).add(Attributes.ATTACK_SPEED, new AttributeModifier(TridentItem.BASE_ATTACK_SPEED_UUID, "Tool modifier", -2.9000000953674316D, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND).build();
     }
 
     public static Tool createToolProperties() {
@@ -73,58 +64,86 @@
 
     @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 entityhuman) {
+            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, LivingEntity.getSlotForHand(user.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.hasInfiniteMaterials()) {
-                                thrownTrident.pickup = AbstractArrow.Pickup.CREATIVE_ONLY;
+                        // itemstack.hurtAndBreak(1, entityhuman, EntityLiving.getSlotForHand(entityliving.getUsedItemHand())); // CraftBukkit - moved down
+                        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.hasInfiniteMaterials()) {
+                                entitythrowntrident.pickup = AbstractArrow.Pickup.CREATIVE_ONLY;
                             }
 
-                            world.addFreshEntity(thrownTrident);
-                            world.playSound(null, thrownTrident, SoundEvents.TRIDENT_THROW, SoundSource.PLAYERS, 1.0F, 1.0F);
-                            if (!player.hasInfiniteMaterials()) {
-                                player.getInventory().removeItem(stack);
+                            // CraftBukkit start
+                            // Paper start - PlayerLaunchProjectileEvent
+                            com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(stack), (org.bukkit.entity.Projectile) entitythrowntrident.getBukkitEntity());
+                            if (!event.callEvent() || !world.addFreshEntity(entitythrowntrident)) {
+                                // Paper end - PlayerLaunchProjectileEvent
+                                if (entityhuman instanceof net.minecraft.server.level.ServerPlayer) {
+                                    ((net.minecraft.server.level.ServerPlayer) entityhuman).getBukkitEntity().updateInventory();
+                                }
+                                return;
                             }
+
+                            if (event.shouldConsume()) { // Paper - PlayerLaunchProjectileEvent
+                            stack.hurtAndBreak(1, entityhuman, LivingEntity.getSlotForHand(user.getUsedItemHand()));
+                            } // Paper - PlayerLaunchProjectileEvent
+                            entitythrowntrident.pickupItemStack = 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 (event.shouldConsume() && !entityhuman.hasInfiniteMaterials()) {
+                                entityhuman.getInventory().removeItem(stack);
+                            }
+                            // CraftBukkit start - SPIGOT-5458 also need in this branch :(
+                        } else {
+                            stack.hurtAndBreak(1, entityhuman, LivingEntity.getSlotForHand(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 / 180.0)) * Mth.cos(g * (float) (Math.PI / 180.0));
-                        float k = -Mth.sin(g * (float) (Math.PI / 180.0));
-                        float l = Mth.cos(f * (float) (Math.PI / 180.0)) * Mth.cos(g * (float) (Math.PI / 180.0));
-                        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.onGround()) {
-                            float o = 1.1999999F;
-                            player.move(MoverType.SELF, new Vec3(0.0, 1.1999999F, 0.0));
+                    entityhuman.awardStat(Stats.ITEM_USED.get(this));
+                    if (k > 0) {
+                        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;
+                        org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerRiptideEvent(entityhuman, stack, f2, f3, f4); // CraftBukkit
+                        entityhuman.push((double) f2, (double) f3, (double) f4);
+                        entityhuman.startAutoSpinAttack(20);
+                        if (entityhuman.onGround()) {
+                            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(null, player, soundEvent, SoundSource.PLAYERS, 1.0F, 1.0F);
+                        world.playSound((Player) null, (Entity) entityhuman, soundeffect, SoundSource.PLAYERS, 1.0F, 1.0F);
                     }
+
                 }
             }
         }
@@ -132,14 +151,15 @@
 
     @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);
         }
     }
 
@@ -156,8 +176,9 @@
 
     @Override
     public Projectile asProjectile(Level world, Position pos, ItemStack stack, Direction direction) {
-        ThrownTrident thrownTrident = new ThrownTrident(world, pos.x(), pos.y(), pos.z(), stack.copyWithCount(1));
-        thrownTrident.pickup = AbstractArrow.Pickup.ALLOWED;
-        return thrownTrident;
+        ThrownTrident entitythrowntrident = new ThrownTrident(world, pos.x(), pos.y(), pos.z(), stack.copyWithCount(1));
+
+        entitythrowntrident.pickup = AbstractArrow.Pickup.ALLOWED;
+        return entitythrowntrident;
     }
 }
