Ahoj, Učím se zatím úplně od začátku a narazil jsem na problém :
[code=java5]package me.n8t8n.healingplugin;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class plugin extends JavaPlugin {
public void onDisable() {
System.out.println("Healing Plugin has been disabled.");
}
public void onEnable() {
System.out.println("Healing Plugin has been enabled");
}
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Player player = (Player) sender;
if(commandLabel.equalsIgnoreCase("heal") || commandLabel.equalsIgnoreCase("h")) {
if(args.length == 0) {
//heal = 0 args /heal N8t8n = 1args
player.setHealth(20);
player.sendMessage(ChatColor.AQUA + "You have been healed");
return true;
} else if(args.length == 1) {
}
}
return false;
}
}
[/code]
player.setHealth(20); Mi to označí za chybu, učím se podle YT Videí a jsem zatím u 2. tutoriálu, nic těžkého to není vím..
Bukkit API - Healing Plugin
-
- Příspěvky: 176
- Registrován: 24 zář 2014, 16:33
- Reputation: 0
- DenOwq
- Příspěvky: 2703
- Věk: 28
- Registrován: 06 bře 2014, 21:26
- Reputation: 2
- zdenda204
- Příspěvky: 3617
- Věk: 36
- Registrován: 23 kvě 2012, 21:38
- Reputation: 0
Re: Bukkit API - Healing Plugin
Podle tohoto (jestli dobře čtu), tak má.
http://jd.bukkit.org/rb/apidocs/org/buk ... eable.html
http://jd.bukkit.org/rb/apidocs/org/buk ... eable.html
- DenOwq
- Příspěvky: 2703
- Věk: 28
- Registrován: 06 bře 2014, 21:26
- Reputation: 2
Re: Bukkit API - Healing Plugin
Jednoduše použij
[code=java5]player.setHealth(20d);[/code] nebo
[code=java5]player.setHealth((double) 20);[/code] nebo
[code=java5]player.setHealth(new Double(20))[/code]
[code=java5]player.setHealth(20d);[/code] nebo
[code=java5]player.setHealth((double) 20);[/code] nebo
[code=java5]player.setHealth(new Double(20))[/code]
Muhahha.
-
- Příspěvky: 176
- Registrován: 24 zář 2014, 16:33
- Reputation: 0
Re: Bukkit API - Healing Plugin
Díky, použil jsem player.setHealth(20.0);
Díky moc

Kdo je online
Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 11 hostů