-
Total de itens
343 -
Registro em
-
Última visita
Respostas na Comunidade
-
Karamujo's postagem in [Resolvido] [Duvida] Replace em setlore Bukkit was marked as the answer
setLore((List<String>) Main.pl.getConfig().getList("staff").replace("&", "§")); e na config nas lista coloca assim 'aqui o item da lista '
ou tenta assim
ItemStack itemSla = new ItemStack(Material.DIAMOND_BLOCK); ItemMeta itemSlaM = itemSla.getItemMeta(); List<String> list = config; List<String> replace = new ArrayList<String>(); for (String string : list) { replace.add(string.replace("&", "§")); } iteSlaM.setlore(replace); -
Karamujo's postagem in [Resolvido] Reset de mapa was marked as the answer
Voce pode fazer por schematic ai toda vez que a partida acabar voce coloca para recarregar schematic
Primeiro voce cria uma File recuperando o valor da schematic
Depois se carrega ela depois voce cola ela em tal mundo.
Vou dar um exemplo mas faço o seu
@SuppressWarnings({ "deprecation", "unused" }) private static void carregarArena(World world, File file,com.sk89q.worldedit.Vector origin) throws DataException, IOException, MaxChangedBlocksException { EditSession edits = new EditSession(new BukkitWorld(world), 999999999); CuboidClipboard c = CuboidClipboard.loadSchematic(file); c.paste(edits, origin, true); } public static void pasteBlockOneSchematic(Player p) throws DataException, IOException { try { carregarArena(p.getWorld(), new File("sla/schematic.schematic"), BukkitUtil.toVector(p.getLocation())); } catch (final MaxChangedBlocksException e) { e.printStackTrace(); } } -
Karamujo's postagem in [Resolvido] Tá certo? was marked as the answer
Não seria assim faltou criar a variavel "P" que seria player
@EventHandler(priority = EventPriority.MONITOR) public void onHurt(EntityDamageByEntityEvent event) { if(event.getEntityType() == EntityType.PLAYER ) { Player p = (Player) event.getEntity(); p.sendMessage("§aVocê levou dano!"); p.playSound(Sound.STEVE_DAMAGE); } } -
Karamujo's postagem in [Resolvido] Armazenando locais was marked as the answer
Seguinte voce pode fazer de inumeras formas porem eu faria assim.
Primeiro faria salvar em algum lugar para depois poder pega-lo do lugar
Bom ai ja pega o local do player que sera definido quando chamar o metodo e o nome que seria o arg1
Não esqueça isso e so um exemplo voce iria precisa ver se contais ja um com o mesmo nome para fazer isso so verificar na config
public void setWarp(Player p, String name) { int x =p.getLocation().getBlockX(); int y =p.getLocation().getBlockY(); int z =p.getLocation().getBlockZ(); World w =p.getWorld(); Location newWarp = new Location(w,x,y,z); Main.getInstance().getConfig().set(name, newWarp); } e para recupera-lo depois é so usa get na config
public Location getWarp(String name) { if(Main.getInstance().getConfig().contains(name)){ Location warpSelecionado = (Location) Main.getInstance().getConfig().get(name); return warpSelecionado; }else { return null; } } Bom como disse faz o sistema de verificar se o nome ja tem, sistema de delwarp so apagar na config
Fazendo +/- assim se set o object que seria o warp para 0
Tente não copiar o codigo
-
Karamujo's postagem in [Resolvido] 2 Duvidas was marked as the answer
Like custa nd enfim faz assim
@EventHandler public void matar(PlayerDeathEvent e) { Player p = e.getEntity().getKiller(); int random = new Random().nextInt(numeros de poção que pssa cair); if(e.getEntityType() == EntityType.PLAYER) { if(random == 1) { ItemStack poção1 = new ItemStack(Material.POTION,1,(short) 8193); p.getInventory().addItem(poção1); } if(random == 2) { ItemStack poção1 = new ItemStack(Material.POTION,1,(short) 8257); p.getInventory().addItem(poção1); } if(random == 3) { ItemStack poção1 = new ItemStack(Material.POTION,1,(short) 8193); p.getInventory().addItem(poção1); } if(random == 4) { ItemStack poção1 = new ItemStack(Material.POTION,1,(short) 8193); p.getInventory().addItem(poção1); }if(random == 5) { ItemStack poção1 = new ItemStack(Material.POTION,1,(short) 8193); p.getInventory().addItem(poção1); } if(random == 6) { ItemStack poção1 = new ItemStack(Material.POTION,1,(short) 8193); p.getInventory().addItem(poção1); } } } Onde e o (short) e a data value do item ou seja o tipo da poção
Olha a data value nesse site http://minecraft.gamepedia.com/Potionde cada poção a DV e a Data Value
-
Karamujo's postagem in [Resolvido] [Dúvida] Mesmo erro de ontem. was marked as the answer
Cria uma variavel para o scheduler, e usa o canceltask quando ele digita /visivel
@Edit
Tira isso da sua primeira condição
|| command.getName().equalsIgnoreCase("invisivel"))
e tambem cria uma variavel usando int
int scheduler = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this(caso for a class main), New Runnable(), 0, 7L)
Bukkit.getServer().getScheduler().cancelTask(scheduler); -
Karamujo's postagem in [Resolvido] [Dúvida/Ajuda] Como resolver? was marked as the answer
Seguinte cria um metodo para scheduler e coloca dentro do onEnable(); assim
public static void task(Player p) { BukkitScheduler scheduler = getServer().getScheduler(); scheduler.scheduleAsyncRepeatingTask(this, new Runnable() { public void run() { p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 10, 30), true); } }, 0, 20L); } no onEnable();
public void onEnable() { task(); } O Comando assim
if(command.getName().equalsIgnoreCase("invisivel")){ if(p.hasPermission(getConfig().getString("Permissao"))){ task(); p.sendMessage(getConfig().getString("MsgInvisivel").replace("&", "§")); }else{ p.sendMessage(getConfig().getString("Sem_Permissao").replace("&", "§")); } } Obs: ou troca 20 por 7L
-
Karamujo's postagem in [Resolvido] Probleminha was marked as the answer
Bom seguinte faz tudo em um evento assim
@SuppressWarnings("deprecation") @EventHandler public void Interact(PlayerInteractEvent e) { Player p = e.getPlayer(); if(JLobby.contains(p.getName())) { if((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) { if(e.getItem().getType() == Material.getMaterial(402)) { for(Player p1 : Bukkit.getOnlinePlayers()) { if(p1.hasPermission("lobby.staff")) { p.showPlayer(p1); } else if(p1.hasPermission("lobby.youtuber")) { p.showPlayer(p1); } else { p.hidePlayer(p1); } ItemStack magmacream = new ItemStack(Material.getMaterial(385)); ItemMeta magmacreamm = magmacream.getItemMeta(); magmacreamm.setDisplayName("§aMostrar todos os jogadores"); magmacreamm.setLore(Arrays.asList("§3Clique aqui para mostrar todos os jogadores.")); magmacream.setItemMeta(magmacreamm); p.getInventory().setItem(7, magmacream); p.updateInventory(); p.sendMessage("§aTodos os jogadores foram escondidos!"); } }if(e.getItem().getType() == Material.getMaterial(385)) { for(Player p1 : Bukkit.getOnlinePlayers()) { p.showPlayer(p1); } ItemStack slimeball = new ItemStack(Material.getMaterial(402)); ItemMeta slimeballm = slimeball.getItemMeta(); slimeballm.setDisplayName("§cEsconder todos os jogadores"); slimeballm.setLore(Arrays.asList("§3Clique aqui para esconder todos os jogadores.")); slimeball.setItemMeta(slimeballm); p.getInventory().setItem(7, slimeball); p.updateInventory(); p.sendMessage("§cTodos os jogadores não estão mais escondidos!"); }else { return; } } } } Caso não funcionar tente usando getItemHand() usei getItem pq antes vem o right click enfim teste os 2
Like moço
-
Karamujo's postagem in [Resolvido] Como obter o nivel de uma determinada skill do mcmmo was marked as the answer
getXP();
Tem o retorno de player level xp e skill do tipo getNonChildSkillType <- isso retorna uma enum com os tipo de skill
-
Karamujo's postagem in [Resolvido] Metodos Get / is was marked as the answer
e que e o seguinte essa variavel get que agnt usa no bukkit ela ja foi "Protegida" pela API do bukkit ou seja agnt so usa elas para pegar
No caso voce precisa definir um valor de atributo
-
Karamujo's postagem in [Resolvido] 2 Dúvidas. was marked as the answer
Podzol
ItemStack item = new ItemStack(Material.DIRT, 1 , (short) 2); Laço
ItemStack laço = new ItemStack(Material.getMaterial(420)); -
Karamujo's postagem in [Resolvido] Erro Eclipse was marked as the answer
Atualize seu JAVA para o 7
ele ta tentando procurar pelo java e nao ta encontrando parece ve se voce não trocou o local do arquivo
caso não reinstale que volta as config padrão (reinstale o java)
-
Karamujo's postagem in [Resolvido] Area do jogador was marked as the answer
Iterator<ProtectedRegion> regiao = getWorldGuard().getRegionManager(p.getlocation().getWorld()).getApplicableRegions(p.getlocation()).iterator();
-
Karamujo's postagem in [Resolvido] Como mudar o critical was marked as the answer
Tenta assim
@EventHandler
public void s(EntityDamageByEntityEvent e) {
if (e.getEntity().isOnGround() && e.getEntity().getVelocity().getY() < 0) {
//continua assim exemplo
World local = e.getEntity().getWorld();
local.playEffect(e.getEntity().getLocation(), Effect.CRIT, 5);
}
Like </3
-
Karamujo's postagem in [Resolvido] Como capturar o evento click was marked as the answer
eu faria assim
@EventHandler
public void click(PlayerInteractEntityEvent event)
{
Player click = (Player) event.getRightClicked();
if(click instanceof Player)
{
//continua
}
}
Like Resolvido
-
Karamujo's postagem in [Resolvido] Duvida Comando. was marked as the answer
acredito que na main nao precisa implementa o command
e tenta colocar seu plugin.yml ta da um espaço entre author e commands e uma barra de space a + em description
-
Karamujo's postagem in [Entregue] [PEDIDO] /foguete was marked as the answer
Fazendo add skype para eu passar.
enzo-guimaraes
-
Karamujo's postagem in [Resolvido] [Duvida] String + Random was marked as the answer
Se pode tipo que criar um metodo para os kits liberado, e dps adc na random
no metodo se verefica os kits que o player tem