- Баллы
- 76
- Имя в Minecraft
- Solomka
Как сетать строку, например, %time_left% отображал число из конфига. Как это сделать?
Знаю, что вопрос глупый, но очень надо)
Например, как взять число от сюда?
getInt("TimeEffect");
Знаю, что вопрос глупый, но очень надо)
Например, как взять число от сюда?
getInt("TimeEffect");
Код:
send(p, translateAlternateColorCodes('&', "&c&l[!] &f&nYou have successfully used the rune!&a The flight effect lasts exactly " + getInt("TimeEffect") + "s!"));
Код:
if(item.getItemMeta().getDisplayName().equals(translateAlternateColorCodes('&', "&c&lRune &b&lFLY"))){
send(p, translateAlternateColorCodes('&', "&c&l[!] &f&nYou have successfully used the rune!&a The flight effect lasts exactly " + getInt("TimeEffect") + "s!"));
p.setAllowFlight(true);
fly.add(p);
new BukkitRunnable(){
@Override
public void run() {
if(fly.contains(p)){
if(p.getLocation().getY() > 10) {
p.teleport(new Location(Bukkit.getWorld(p.getLocation().getWorld().getName()), p.getLocation().getX(), p.getLocation().getY() - 5, p.getLocation().getZ()));
p.setAllowFlight(false);
cancel();
}
p.teleport(new Location(Bukkit.getWorld(p.getLocation().getWorld().getName()), p.getLocation().getX(), p.getLocation().getY() - 2, p.getLocation().getZ()));
p.setAllowFlight(false);
send(p, translateAlternateColorCodes('&', "&c&l[!] &6The rune has expired!"));
cancel();
}
}
}.runTaskLater(Main.getInstance(), getInt("TimeEffect") * 20L);
p.getInventory().getItemInMainHand().setAmount(p.getInventory().getItemInMainHand().getAmount() - 1);
p.updateInventory();
return;
}
}