當前位置: 首頁>>代碼示例>>Java>>正文


Java Material.EYE_OF_ENDER屬性代碼示例

本文整理匯總了Java中org.bukkit.Material.EYE_OF_ENDER屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.EYE_OF_ENDER屬性的具體用法?Java Material.EYE_OF_ENDER怎麽用?Java Material.EYE_OF_ENDER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.EYE_OF_ENDER屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isInteractableItem

/**
 * checks if this item is interactable
 */
public static boolean isInteractableItem(ItemStack item) {
	if (item == null || item.getType() == Material.AIR) {
		return false;
	}
	if (item.getType().isBlock()) {
		return true;
	}
	if (item.getType() == Material.REDSTONE || item.getType() == Material.WATER_BUCKET || item.getType() == Material.LAVA_BUCKET) {
		return true;
	}
	if (item.getType() == Material.MONSTER_EGG) {
		return true;
	}
	if (item.getType() == Material.EGG || item.getType() == Material.SNOW_BALL || item.getType() == Material.BOW || item.getType() == Material.ENDER_PEARL || item.getType() == Material.EYE_OF_ENDER || item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION || item.getType() == Material.EXP_BOTTLE || item.getType() == Material.FIREWORK_CHARGE) {
		return true;
	}
	if (item.getType().isEdible()) {
		return true;
	}
	return false;
}
 
開發者ID:RoboTricker,項目名稱:Transport-Pipes,代碼行數:24,代碼來源:HitboxUtils.java

示例2: onRecord

@EventHandler
public void onRecord(PlayerInteractEvent e)
{
  Player p = e.getPlayer();
  if ((modMode.contains(p.getName())) && (p.getItemInHand().getType() == Material.EYE_OF_ENDER) && (e.getAction().toString().contains("RIGHT")))
  { 
    Player random = Bukkit.getOnlinePlayers()[new java.util.Random().nextInt(Bukkit.getOnlinePlayers().length)];
    if (Bukkit.getOnlinePlayers().length == 1)
      p.sendMessage(ChatColor.RED + "§6§ §rOops, seems like there are not enough players to use this.");
      e.setCancelled(true);
    if (Bukkit.getOnlinePlayers().length > 1) {
      if (p != random) {
        p.teleport(random);
        p.sendMessage(ChatColor.YELLOW + " §6§ §rYou were teleported randomly to §c" + random.getName() + "§r.");
        e.setCancelled(true);
      }
      if (p == random) {
      	p.sendMessage(ChatColor.YELLOW + "§6§ §rOops, seems like we accidently found you. Please try again!");
      	e.setCancelled(true);
      }
    }
  }
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:23,代碼來源:ModeratorMode.java

示例3: getIcon

@Override
public ItemStack getIcon()
{
    return new ItemStack(Material.EYE_OF_ENDER, 1);
}
 
開發者ID:SamaGames,項目名稱:Hub,代碼行數:5,代碼來源:DimensionsGame.java

示例4: modItems

public static void modItems(Player p)
{
  Inventory inv = p.getInventory();
  inv.clear();
  ItemStack modCompass = new ItemStack(Material.COMPASS);
  ItemStack modBook = new ItemStack(Material.BOOK);
  ItemStack modFreeze = new ItemStack(Material.PACKED_ICE);
  ItemStack modTp = new ItemStack(Material.EYE_OF_ENDER);
  ItemStack modVanish = new ItemStack(Material.FEATHER);
 
  ItemMeta compassMeta = modCompass.getItemMeta();
  ItemMeta bookMeta = modBook.getItemMeta();
  ItemMeta freezeMeta = modFreeze.getItemMeta();
  ItemMeta tpMeta = modTp.getItemMeta();
  ItemMeta vanishMeta = modVanish.getItemMeta();
 
  compassMeta.setDisplayName("§cWhoosh");
  bookMeta.setDisplayName("§cInspect Player");
  freezeMeta.setDisplayName("§cFreeze Player");
  vanishMeta.setDisplayName("§cToggle Vanish");
  tpMeta.setDisplayName("§cRandom Teleporter");
 
  ArrayList<String> modCompassLore = new ArrayList();
  ArrayList<String> modBookLore = new ArrayList();
  ArrayList<String> modFreezeLore = new ArrayList();
  ArrayList<String> modVanishLore = new ArrayList();
  ArrayList<String> modTpLore = new ArrayList();
 
  modCompassLore.add("§7Used to teleport to eye location.");
  modBookLore.add("§7Used to inspect a players inventory.");
  modFreezeLore.add("§7Used to freeze a player.");
  modVanishLore.add("§7Used to toggle vanish.");
  modTpLore.add("§7Used to teleport to a random player.");
 
  compassMeta.setLore(modCompassLore);
  bookMeta.setLore(modBookLore);
  freezeMeta.setLore(modFreezeLore);
  vanishMeta.setLore(modVanishLore);
  tpMeta.setLore(modTpLore);
 
  modCompass.setItemMeta(compassMeta);
  modBook.setItemMeta(bookMeta);
  modFreeze.setItemMeta(freezeMeta);
  modTp.setItemMeta(tpMeta);
  modVanish.setItemMeta(vanishMeta);
 
  inv.setItem(0, modCompass);
  inv.setItem(3, modVanish);
  inv.setItem(4, modBook);
  inv.setItem(5, modFreeze);
  inv.setItem(8, modTp);
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:52,代碼來源:ModeratorMode.java


注:本文中的org.bukkit.Material.EYE_OF_ENDER屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。