Ir para conteúdo
  • 0

[Entregue] Plugin não funciona


Guest VitorEmanoel

Pergunta

Guest VitorEmanoel

Criei um plugin de RandomTP, ele inciar no console tudo certo sem erro, mais na hora que entro no servidor e digito o comando não acontece nada.

Me ajudem please

 

Codigo:

package com.projectcraft.skizzgamer.handleworld;
 
import java.util.Random;
 
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
 
public class main extends JavaPlugin{
       
        public void OnEnable(){
                Bukkit.getConsoleSender().sendMessage("[WorldManger] Ativado");
                getCommand("rtp").setExecutor(this);
        }
       
        public void OnDisable(){
                Bukkit.getConsoleSender().sendMessage("[WorldManger] Desabilitado");
        }
        public boolean OnCommand(CommandSender sender, Command command, String label, String[] args){
                if (command.getName().equalsIgnoreCase("rtp")){
                        if (!(sender instanceof Player)){
                        }else{
                        sender.sendMessage("&cVoce nao pode usar este comando no console");
                        return true;
                        }
                Random random = new Random();
                Player p = (Player)sender;
                p.teleport(p.getWorld().getHighestBlockAt(random.nextInt(10000), random.nextInt(1000)).getLocation());
                Location location = p.getWorld().getHighestBlockAt(random.nextInt(1000), random.nextInt(1000)).getLocation();
                sender.sendMessage("Voce foi teleportado para um local aleatorio");
                while (location.getBlock().isLiquid());
                location = p.getWorld().getHighestBlockAt(random.nextInt(1000), random.nextInt(1000)).getLocation();
 
                }
        return false;
        }
       
}

Download Plugin:

http://www.mediafire.com/download/79dguwzdhcoc1cq/RandomTP.jar

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

Guest VitorEmanoel

Você colocou na plugin.yml?

Sim

name: RandomTP
main: com.projectcraft.randomtp.Main
version: 1.0

commands:
    rtp:
        description: Teleporte aleatorio
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...