Daimonte Postado Agosto 10, 2017 Denunciar Compartilhar Postado Agosto 10, 2017 Como faço para ao executar um comando um item ser colocado no caso setado a onde o player está? Outra pergunta: Como faço para colocar um holograma em cima de um item ? Link para o comentário Compartilhar em outros sites More sharing options...
zAth Postado Agosto 11, 2017 Denunciar Compartilhar Postado Agosto 11, 2017 Eu não falei ISSO, eu falei simplesmente que quando eu digitar um comando como: /pedra Uma pedra ser colocado onde o jogador está!!! player.getLocation().getBlock().setType(Material.STONE); No caso enderchest é tipo: player.getLocation().getBlock().setType(Material.ENDER_CHEST); Eu já falei, até você já falou.. quer pegar o material pelo comando? Material.valueOf("STONE"); 1 Link para o comentário Compartilhar em outros sites More sharing options...
zAth Postado Agosto 10, 2017 Denunciar Compartilhar Postado Agosto 10, 2017 Item item = (Item) player.getWorld().spawnEntity(player.getLocation(), EntityType.DROPPED_ITEM); item.setItemStack(new ItemStack(Material.DIAMOND)); Link para o comentário Compartilhar em outros sites More sharing options...
Daimonte Postado Agosto 10, 2017 Autor Denunciar Compartilhar Postado Agosto 10, 2017 Item item = (Item) player.getWorld().spawnEntity(player.getLocation(), EntityType.DROPPED_ITEM); item.setItemStack(new ItemStack(Material.DIAMOND)); Ele vai colocar o item, ou vai droppar o item ? Link para o comentário Compartilhar em outros sites More sharing options...
zAth Postado Agosto 10, 2017 Denunciar Compartilhar Postado Agosto 10, 2017 Ele vai colocar o item, ou vai droppar o item ? Vai dropar ;-; como assim "colocar" ? Link para o comentário Compartilhar em outros sites More sharing options...
Daimonte Postado Agosto 10, 2017 Autor Denunciar Compartilhar Postado Agosto 10, 2017 Vai dropar ;-; como assim "colocar" ? Ele vai por exemplo um setblock, ele vai setar o bloco onde o player está Link para o comentário Compartilhar em outros sites More sharing options...
zAth Postado Agosto 10, 2017 Denunciar Compartilhar Postado Agosto 10, 2017 Ele vai por exemplo um setblock, ele vai setar o bloco onde o player está mas Item não é bloco ;-; c quer que não dê para pegar o item? não estou entendendo.. Link para o comentário Compartilhar em outros sites More sharing options...
Daimonte Postado Agosto 10, 2017 Autor Denunciar Compartilhar Postado Agosto 10, 2017 mas Item não é bloco ;-; c quer que não dê para pegar o item? não estou entendendo.. Você vai digitar o comando e simplesmente ele vai por um bloco a onde o player está Link para o comentário Compartilhar em outros sites More sharing options...
zAth Postado Agosto 10, 2017 Denunciar Compartilhar Postado Agosto 10, 2017 Você vai digitar o comando e simplesmente ele vai por um bloco a onde o player está player.getLocation().getBlock().setType(Material.STONE); Link para o comentário Compartilhar em outros sites More sharing options...
Daimonte Postado Agosto 10, 2017 Autor Denunciar Compartilhar Postado Agosto 10, 2017 player.getLocation().getBlock().setType(Material.STONE); No caso enderchest é tipo: player.getLocation().getBlock().setType(Material.ENDER_CHEST); Link para o comentário Compartilhar em outros sites More sharing options...
zAth Postado Agosto 10, 2017 Denunciar Compartilhar Postado Agosto 10, 2017 No caso enderchest é tipo: player.getLocation().getBlock().setType(Material.ENDER_CHEST); Ainda não entendi oq quer :headbang: é bloco ou é item? já falei os 2 Link para o comentário Compartilhar em outros sites More sharing options...
Guest Niigote Postado Agosto 10, 2017 Denunciar Compartilhar Postado Agosto 10, 2017 Ainda não entendi oq quer :headbang: é bloco ou é item? já falei os 2 Tem servidores,que embaixo do holograma,tem um item flutuando,dropado,embaixo do holograma soq no ar.E n da para pegar este item,e tipo um holograma na loja com um catalogo de blocos e ele qr por uma stone.Resumindo,tipo um holograma soq de item,mas vai ter os 2 Link para o comentário Compartilhar em outros sites More sharing options...
zAth Postado Agosto 10, 2017 Denunciar Compartilhar Postado Agosto 10, 2017 Achei aqui uma classe import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; public class FlyingItems { private ArmorStand armorstand; private Location location; private String text = null; private Boolean h = false; private ItemStack itemstack; private double height = -1.3; FlyingItems(){ } public void setLocation(Location location){ this.location = location; } public void setText(String text){ this.text = text; } public void setItemStack(ItemStack itemstack){ this.itemstack = itemstack; } public void setHeight(double height){ this.height = height - 1.3; if(this.location != null){ this.location.setY(this.location.getY() + this.height); h = true; } } public void remove(){ this.location = null; this.armorstand.remove(); this.armorstand.getPassenger().remove(); this.armorstand = null; this.h = false; this.height = 0; this.text = null; this.itemstack = null; } public void teleport(Location location){ if(this.location != null){ armorstand.teleport(location); this.location = location; } } public void spawn(){ if(!h){ this.location.setY(this.location.getY()+this.height); h = true; } armorstand = (ArmorStand)this.location.getWorld().spawn(this.location, ArmorStand.class); armorstand.setGravity(false); armorstand.setVisible(false); Item i = this.location.getWorld().dropItem(this.getLocation(), this.itemstack); i.setPickupDelay(2147483647); if(this.text != null){ i.setCustomName(this.text); i.setCustomNameVisible(true); } armorstand.setPassenger(i); } public Location getLocation(){ return this.location; } public ItemStack getItemStack(){ return this.itemstack; } public double getHeight(){ return this.height; } public String getText(){ return this.text; } } FlyingItems fly = new FlyingItems(); fly.setLocation(location); fly.setHeight(0.85); fly.setMaterial(Material.WOOD); fly.setText("§4Holz §b25$"); fly.spawn(); Créditos Link para o comentário Compartilhar em outros sites More sharing options...
Daimonte Postado Agosto 11, 2017 Autor Denunciar Compartilhar Postado Agosto 11, 2017 Achei aqui uma classe import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; public class FlyingItems { private ArmorStand armorstand; private Location location; private String text = null; private Boolean h = false; private ItemStack itemstack; private double height = -1.3; FlyingItems(){ } public void setLocation(Location location){ this.location = location; } public void setText(String text){ this.text = text; } public void setItemStack(ItemStack itemstack){ this.itemstack = itemstack; } public void setHeight(double height){ this.height = height - 1.3; if(this.location != null){ this.location.setY(this.location.getY() + this.height); h = true; } } public void remove(){ this.location = null; this.armorstand.remove(); this.armorstand.getPassenger().remove(); this.armorstand = null; this.h = false; this.height = 0; this.text = null; this.itemstack = null; } public void teleport(Location location){ if(this.location != null){ armorstand.teleport(location); this.location = location; } } public void spawn(){ if(!h){ this.location.setY(this.location.getY()+this.height); h = true; } armorstand = (ArmorStand)this.location.getWorld().spawn(this.location, ArmorStand.class); armorstand.setGravity(false); armorstand.setVisible(false); Item i = this.location.getWorld().dropItem(this.getLocation(), this.itemstack); i.setPickupDelay(2147483647); if(this.text != null){ i.setCustomName(this.text); i.setCustomNameVisible(true); } armorstand.setPassenger(i); } public Location getLocation(){ return this.location; } public ItemStack getItemStack(){ return this.itemstack; } public double getHeight(){ return this.height; } public String getText(){ return this.text; } } FlyingItems fly = new FlyingItems(); fly.setLocation(location); fly.setHeight(0.85); fly.setMaterial(Material.WOOD); fly.setText("§4Holz §b25$"); fly.spawn(); Créditos Eu não falei ISSO, eu falei simplesmente que quando eu digitar um comando como: /pedra Uma pedra ser colocado onde o jogador está!!! Link para o comentário Compartilhar em outros sites More sharing options...
bieel1503 Postado Agosto 11, 2017 Denunciar Compartilhar Postado Agosto 11, 2017 Eu não falei ISSO, eu falei simplesmente que quando eu digitar um comando como: /pedra Uma pedra ser colocado onde o jogador está!!! Desculpa me intrometer, mas ele já falou como fazer isso: player.getLocation().getBlock().setType(Material.STONE); Link para o comentário Compartilhar em outros sites More sharing options...
MrTBR Postado Agosto 11, 2017 Denunciar Compartilhar Postado Agosto 11, 2017 Sua dúvida foi marcada como [Resolvido] e movido à área de dúvidas resolvidas. Atenciosamente, Gamer's Board Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Daimonte
Como faço para ao executar um comando um item ser colocado no caso setado a onde o player está?
Outra pergunta:
Como faço para colocar um holograma em cima de um item ?
Link para o comentário
Compartilhar em outros sites
15 respostass a esta questão
Posts Recomendados