本文整理匯總了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);
}