I have programmed a Minecraft plugin for 1.8 that can be healed with / heal. The problem now is that when I type / heal that I'm healed and chatting
Brockdish was healed!
/ heal
stands. Do you know how to do it so that the chat is not / heal?
This is my code:
package net. *********. Commands;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Heal implements CommandExecutor {
@Override
public boolean onCommand (CommandSender sender, Command command, String label, String [] args) {
if (sender instanceof Player) {
Player player = (player) transmitter;
player.setHealth (player.getMaxHealth ());
player.setFoodLevel (20);
Bukkit.broadcastMessage ("§2" + player.getName () + "§a was healed!");
} else
sender.sendMessage ("§cYou have to be a player to run this command!");
return false;
}
}
Because you always
return false
do you have to under
Bukkit.broadcastMessage
return true
Don't always return false
Caught.
Thank you
Stop editing all the news. XD
Thank you
XD
Hehe has changed one or the other comment here ^^