本文整理了Java中org.bukkit.entity.Item.getCustomName()
方法的一些代码示例,展示了Item.getCustomName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Item.getCustomName()
方法的具体详情如下:
包路径:org.bukkit.entity.Item
类名称:Item
方法名:getCustomName
暂无
代码示例来源:origin: jiongjionger/NeverLag
if (displaying || (item.getCustomName() == null || !item.isCustomNameVisible())) {
item.setCustomName(message);
item.setCustomNameVisible(message != null);
代码示例来源:origin: TheBusyBiscuit/Slimefun4
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
Item stack = AncientAltarListener.findItem(b);
if (stack != null) {
stack.removeMetadata("item_placed", SlimefunStartup.instance);
b.getWorld().dropItem(b.getLocation(), AncientAltarListener.fixItemStack(stack.getItemStack(), stack.getCustomName()));
stack.remove();
}
return true;
}
});
代码示例来源:origin: TheBusyBiscuit/Slimefun4
private void checkPedestal(Block pedestal) {
Item item = AncientAltarListener.findItem(pedestal);
if (item == null) abort();
else {
particles.add(pedestal.getLocation().add(0.5, 1.5, 0.5));
items.add(AncientAltarListener.fixItemStack(item.getItemStack(), item.getCustomName()));
pedestal.getWorld().playSound(pedestal.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 5F, 2F);
try {
l.getWorld().spawnParticle(Particle.ENCHANTMENT_TABLE,pedestal.getLocation().add(0.5, 1.5, 0.5),16, 0.3F, 0.2F, 0.3F);
l.getWorld().spawnParticle(Particle.CRIT_MAGIC,pedestal.getLocation().add(0.5, 1.5, 0.5), 8,0.3F, 0.2F, 0.3F);
} catch (Exception e) {
e.printStackTrace();
}
item.remove();
pedestal.removeMetadata("item_placed", SlimefunStartup.instance);
}
}
代码示例来源:origin: TheBusyBiscuit/Slimefun4
e.getPlayer().getInventory().addItem(fixItemStack(stack.getItemStack(), stack.getCustomName()));
e.getPlayer().playSound(b.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1F, 1F);
PlayerInventory.update(e.getPlayer());
for (Block pedestal: pedestals) {
Item stack = findItem(pedestal);
if (stack != null) input.add(fixItemStack(stack.getItemStack(), stack.getCustomName()));
内容来源于网络,如有侵权,请联系作者删除!