本文整理了Java中org.bukkit.entity.Item.setCustomNameVisible()
方法的一些代码示例,展示了Item.setCustomNameVisible()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Item.setCustomNameVisible()
方法的具体详情如下:
包路径:org.bukkit.entity.Item
类名称:Item
方法名:setCustomNameVisible
暂无
代码示例来源:origin: jiongjionger/NeverLag
item.setCustomNameVisible(message != null);
代码示例来源:origin: TheBusyBiscuit/Slimefun4
private void insertItem(Player p, Block b) {
final ItemStack stack = p.getInventory().getItemInMainHand();
if (stack != null) {
PlayerInventory.consumeItemInHand(p);
String nametag = StringUtils.formatItemName(stack, false);
Item entity = b.getWorld().dropItem(b.getLocation().add(0.5, 1.2, 0.5), new CustomItem(new CustomItem(stack, 1), "&5&dALTAR &3Probe - &e" + System.nanoTime()));
entity.setVelocity(new Vector(0, 0.1, 0));
entity.setMetadata("no_pickup", new FixedMetadataValue(SlimefunStartup.instance, "altar_item"));
entity.setCustomNameVisible(true);
entity.setCustomName(nametag);
p.playSound(b.getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.3F, 0.3F);
}
}
内容来源于网络,如有侵权,请联系作者删除!