Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions src/main/java/io/github/brainstormsys/paperutils/SpawnCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,33 @@ public static void spawncomm(){
@Override

public void run(){
if (player.getLocation().distance(startLocation) > 0.1){
player.sendMessage("§4You moved!! Teleportation has been cancelled");
player.playSound(player, Sound.BLOCK_NOTE_BLOCK_BASS, 1f, 1f);
cancel();
return;
}

if (countdown == 0){
player.teleport(new Location(Bukkit.getWorlds().get(0), -2648, 73, -2163, player.getYaw(), player.getPitch()));
player.sendMessage("§2Teleportation Successful!");
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1f, 1f);
player.getWorld().spawnParticle(
try {
if (player.getLocation().distance(startLocation) > 0.1){
player.sendMessage("§4You moved!! Teleportation has been cancelled");
player.playSound(player, Sound.BLOCK_NOTE_BLOCK_BASS, 1f, 1f);
cancel();
return;
}

if (countdown == 0){
player.teleport(new Location(Bukkit.getWorlds().get(0), -2648, 73, -2163, player.getYaw(), player.getPitch()));
player.sendMessage("§2Teleportation Successful!");
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1f, 1f);
player.getWorld().spawnParticle(
Particle.GLOW_SQUID_INK,
player.getLocation(),
100
);
);
cancel();
return;
}
player.sendTitle("§aTeleporting in ", countdown+" §aSeconds", 0, 25, 5 );
player.playSound(player, Sound.UI_BUTTON_CLICK, 1f, 1f);
countdown--;

} catch (Exception ignored) {
cancel();
return;
}
player.sendTitle("§aTeleporting in ", countdown+" §aSeconds", 0, 25, 5 );
player.playSound(player, Sound.UI_BUTTON_CLICK, 1f, 1f);
countdown--;

}
} .runTaskTimer(JavaPlugin.getPlugin(PaperUtils.class), 0L, 20L);

Expand Down