本文整理汇总了Java中org.bukkit.Material.TIPPED_ARROW属性的典型用法代码示例。如果您正苦于以下问题:Java Material.TIPPED_ARROW属性的具体用法?Java Material.TIPPED_ARROW怎么用?Java Material.TIPPED_ARROW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.TIPPED_ARROW属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
@Override
public boolean init(Expression<?>[] expr, int i, Kleenean kleenean, @NotNull SkriptParser.ParseResult parseResult) {
switch (parseResult.mark) {
case 0:
material = Material.POTION;
break;
case 1:
material = Material.SPLASH_POTION;
break;
case 2:
material = Material.LINGERING_POTION;
break;
case 3:
material = Material.TIPPED_ARROW;
break;
default:
material = Material.POTION;
break;
}
potionEffects = (Expression<PotionEffect>) expr[0];
return true;
}
示例2: getRepresentation
/**
* {@inheritDoc}
*/
@Override
public default ItemStack getRepresentation() {
ItemStack stack = new ItemStack(Material.TIPPED_ARROW);
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(ChatColor.GRAY + "Tipped Arrow");
stack.setItemMeta(meta);
return stack;
}
示例3: onShootWithoutArrows
@SuppressWarnings("deprecation")
@EventHandler
public void onShootWithoutArrows(EntityShootBowEvent event)
{
if(event.getEntity() instanceof Player)
{
Player player = (Player)event.getEntity();
if(player.getInventory().getItemInMainHand().getType() == event.getBow().getType())
{
if
(
player.getInventory().getItemInOffHand().getType() == Material.ARROW
|| player.getInventory().getItemInOffHand().getType() == Material.SPECTRAL_ARROW
|| player.getInventory().getItemInOffHand().getType() == Material.TIPPED_ARROW
)
{
event.setCancelled(false);
}
else
{
event.setCancelled(true);
player.sendMessage(ChatColor.RED + Survival.Words.get("Must load Arrows on off hand"));
player.updateInventory();
}
}
else
{
event.setCancelled(true);
player.sendMessage(ChatColor.RED + Survival.Words.get("Must use a Bow with main hand"));
player.updateInventory();
}
}
}
示例4: isPotionItem
public static boolean isPotionItem(@NotNull ItemStack item) {
return (item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION
|| item.getType() == Material.LINGERING_POTION || item.getType() == Material.TIPPED_ARROW);
}