Hello, I would like create a score for : "when the player execute command /jjoin, we add 1 to JumpScore". With this score, I would like detect than if the player has a score in JumpScore and it equal to 1, as soon as the player walk on the block of dirt he is teleport. My code for the moment: Code: public class Main extends JavaPlugin implements Listener{ public void onEnable(){ Bukkit.getServer().getPluginManager().registerEvents(this, this); } @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){ Player p = (Player) sender; ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); if(cmd.getName().equalsIgnoreCase("jjoin")){ p.sendMessage("§8[§b§lY§fJump§8] §6§oTéléportation au jump ! Le compteur est lancé !"); Bukkit.dispatchCommand(console, "warp Jump "+p.getName()); } return false; } @EventHandler public void onFinish(PlayerMoveEvent e){ Player p = e.getPlayer(); Location loc = new Location(p.getWorld(), p.getLocation().getBlockX(), p.getLocation().getBlockY() -1, p.getLocation().getBlockZ()); ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); if(p.getWorld().getBlockAt(loc).getType() == Material. Bukkit.dispatchCommand(console, "warp Jump "+p.getName()); } } } Thanks for your replies. (I am a french for info)
@Spadax What is your issue? What do you mean by score? Do you mean the score for a scoreboard, or just some other value? What have you tried already?
My problem is that I have no idea how to do that, i didn't find a internet page or a video on this subject. I would like a value to detect if the player is in the jump.
@Spadax Create an arraylist. The keys will be UUIDs. This represents all the players with a "Jumpscore". When a player issues that command, add their UUID to the arraylist. When a player moves over dirt, check if they are in the arraylist. If so, teleport them.