Ir para conteúdo

Tiozol

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

  1. Fiz as substituições necessárias, no script não tem erro algum, mas quando vou salvar da isso ai https://prnt.sc/qrjo3k os códigos ActionBar package net.j_dev.naruto; import net.minecraft.server.v1_9_R1.IChatBaseComponent.ChatSerializer; import net.minecraft.server.v1_9_R1.PacketPlayOutChat; import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer; import org.bukkit.entity.Player; public class ActionBar { private PacketPlayOutChat packet; public ActionBar(String text) { PacketPlayOutChat packet = new PacketPlayOutChat(ChatSerializer.a("{\"text\":\"" + text + "\"}"), (byte) 2); this.packet = packet; } public void sendToPlayer(Player p) { ((CraftPlayer)p).getHandle().playerConnection.sendPacket(packet); } } Na class do evento @EventHandler public void danostaff(EntityDamageByEntityEvent e) { org.bukkit.entity.Entity damager = e.getDamager(); Player p = (Player) damager; if (damager instanceof Player && e.getEntity().hasPermission("naruto.imortal")) { if (!p.hasPermission("plugin.imortal")) { e.setCancelled(true); ActionBar ac = new ActionBar(ChatColor.RED+"Você não pode ferir um Staff."); ac.sendToPlayer(p); } } else { e.setCancelled(false); } }
  2. Tiozol

    Ajuda com ActionBar

    Estou tentando colocar uma ActionBar de EntityDamageByEntityEvent mas não to conseguindo e não acho nada na internet, se alguém puder ajudar o código: @EventHandler public void danostaff(EntityDamageByEntityEvent e) { org.bukkit.entity.Entity damager = e.getDamager(); Player p = (Player) damager; if (damager instanceof Player && e.getEntity().hasPermission("plugin.imortal")) { if (!p.hasPermission("naruto.imortal")) { p.sendMessage(ChatColor.RED+"Você não pode ferir um Staff."); e.setCancelled(true); ActionBarAPI.sendActionBar(p, ChatColor.RED+"Você não pode ferir um Staff.", 20); } } else { e.setCancelled(false); } }
×
×
  • Criar Novo...