View difference between Paste ID: S3sscaVR and L1RfgxjK
SHOW: | | - or go back to the newest paste.
1
		if (item.getType() == Material.COMPASS); {
2
			Location spawn = player.getWorld().getSpawnLocation();
3
			//Amount can be edit in the config
4
			//Getting the integer of Amount
5
			int amount = plugin.getConfig().getInt("Amount");
6
			//Making a new location with original values for spawn + the y-value.
7-
			Location loc = new Location(spawn.getWorld(), spawn.getX(), spawn.getY() + amount, spawn.getZ());
7+
			spawn.setY(spawn.getY() + amount);
8
			
9
			//Teleport player + Message
10-
			player.teleport(loc);
10+
			player.teleport(spawn);
11
			player.sendMessage("You have been teleported");
12
			
13
			player.getWorld().playEffect(player.getLocation(), Effect.BLAZE_SHOOT, 1);
14
		}