Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Add sound effect for LaunchpadSystem
Browse files Browse the repository at this point in the history
Incorporated a sound event into the LaunchpadSystem in the SkyPvP module. Specifically, when a player is launched, the sound of a firework rocket launching now plays. This enriches the player experience, making it more immersive and interactive.
  • Loading branch information
mathiasclari committed Dec 24, 2023
1 parent 0923b95 commit 2cbaf4d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.reefrealm.reefrealmskypvp.launcher;

import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand All @@ -15,6 +16,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
Vector direction = player.getEyeLocation().getDirection();
player.setVelocity(direction.multiply(2)); // Adjust the multiplier to control the launch speed
player.playSound(player.getLocation(), Sound.ENTITY_FIREWORK_ROCKET_LAUNCH, 1.0f, 1.0f); // Play a sound
}
}
}
Expand Down

0 comments on commit 2cbaf4d

Please sign in to comment.