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


Java ArmorStand.setHelmet方法代碼示例

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


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

示例1: play

import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
@Override
public void play(PAUser u) {
    if (isInCooldown(u, getName())) return;

    final ArmorStand as = (ArmorStand) spawnEntity(u.getLoc(), EntityType.ARMOR_STAND);
    as.setGravity(false);
    as.setSmall(true);
    as.setVisible(false);
    as.setHelmet(new ItemStack(Material.SEA_LANTERN));
    as.setPassenger(u.getPlayer());

    as.teleport(as.getLocation().add(0, 5, 0));

    bt = plugin.getServer().getScheduler().runTaskTimer(plugin, ()-> {
        as.teleport(as.getLocation().add(0, 0.2, 0));

        if (count <= 0) {
            remove(u, as);
            bt.cancel();
            return;
        }
        count--;
    }, 0, 20);
}
 
開發者ID:cadox8,項目名稱:PA,代碼行數:25,代碼來源:AntiGravity.java

示例2: placeBlock

import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
public ArmorStand placeBlock(Location l) {
	ArmorStand block = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
	block.setSmall(true);
	block.setGravity(false);
	block.setCustomName("CustomBlock");
	block.setCustomNameVisible(false);
	block.setInvulnerable(true);
	block.setVisible(false);
	block.setMarker(true);
	block.setSilent(true);
	
	ItemStack a = new ItemStack(Material.LEATHER_BOOTS);
	a.setDurability((short) primary.getTexture());
	LeatherArmorMeta am = (LeatherArmorMeta) a.getItemMeta();
	am.setColor(primary.getColor());
	am.setUnbreakable(true);
	if (primary.isGlowing()) {
		am.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
	}
	a.setItemMeta(am);
	block.setHelmet(a);
	
	if (secondary != null) {
		ItemStack b = new ItemStack(Material.LEATHER_BOOTS);
		b.setDurability((short) secondary.getTexture());
		LeatherArmorMeta bm = (LeatherArmorMeta) b.getItemMeta();
		bm.setColor(secondary.getColor());
		bm.setUnbreakable(true);
		if (secondary.isGlowing()) {
			System.out.println("H");
			bm.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
		}
		b.setItemMeta(bm);
		block.getEquipment().setItemInMainHand(b);
	}
	
	return block;
}
 
開發者ID:GigaGamma,項目名稱:SuperiorCraft,代碼行數:39,代碼來源:CustomBlockTexture.java

示例3: rewardsChest

import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
public static void rewardsChest(Dungeon dungeon) {
    DungeonBoss db = dungeon.boss;
    World w = db.getLoc().getWorld();
    ArmorStand as = (ArmorStand) w.spawnEntity(db.getLoc().add(0, -1.00, 0), EntityType.ARMOR_STAND);
    as.setGravity(false);
    as.setAI(false);
    as.setVisible(false);
    as.setCustomName(ChatColor.GOLD + "Dungeon Rewards");
    as.setCustomNameVisible(true);
    as.setHelmet(new ItemStack(Material.CHEST));

    ArmorStand as2 = (ArmorStand) w.spawnEntity(db.getLoc().add(0, -0.25, 0), EntityType.ARMOR_STAND);
    as2.setGravity(false);
    as2.setAI(false);
    as2.setVisible(false);
    as2.setCustomName(ChatColor.GREEN + "Disappearing in " + ChatColor.YELLOW + ChatColor.BOLD + "60" + ChatColor.GREEN + "...");
    as2.setCustomNameVisible(true);

    ArmorStand as3 = (ArmorStand) w.spawnEntity(db.getLoc().add(0, -0.50, 0), EntityType.ARMOR_STAND);
    as3.setGravity(false);
    as3.setAI(false);
    as3.setVisible(false);
    as3.setCustomName(ChatColor.GRAY + "[Click to Open]");
    as3.setCustomNameVisible(true);

    db.rewardsStage = true;
    Chunk chunk = as.getLocation().getChunk();
    Chunk chunk2 = as2.getLocation().getChunk();
    Chunk chunk3 = as3.getLocation().getChunk();

    rewardsToBosses.put(as.getUniqueId(), db);
    rewardsToBosses.put(as2.getUniqueId(), db);
    rewardsToBosses.put(as3.getUniqueId(), db);

    RScheduler.schedule(plugin, new Runnable() {
        int counter = 0;
        int sec = 60;

        public void run() {
            if (!chunk.isLoaded() || !chunk2.isLoaded() || !chunk3.isLoaded() || !as.isValid() || !as2.isValid() || !as3.isValid()) {
                db.rewardsStage = false;
                try {
                    as.remove();
                    as2.remove();
                    as3.remove();
                    rewardsToBosses.remove(as.getUniqueId());
                    rewardsToBosses.remove(as2.getUniqueId());
                    rewardsToBosses.remove(as3.getUniqueId());
                    dungeon.boss.spawnSpawner();
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return;
            }
            ((CraftArmorStand) as).getHandle().yaw += 10;
            if (counter++ < RTicks.seconds(60)) {
                RScheduler.schedule(plugin, this, 1);
                if (this.counter % 20 == 0)
                    as2.setCustomName(ChatColor.GREEN + "Disappearing in " + ChatColor.YELLOW + ChatColor.BOLD + (--sec) + ChatColor.GREEN + "...");
            } else {
                db.rewardsStage = false;
                as.remove();
                as2.remove();
                as3.remove();
                rewardsToBosses.remove(as.getUniqueId());
                rewardsToBosses.remove(as2.getUniqueId());
                rewardsToBosses.remove(as3.getUniqueId());
                dungeon.boss.spawnSpawner();
            }
        }
    }, 1);
}
 
開發者ID:edasaki,項目名稱:ZentrelaRPG,代碼行數:73,代碼來源:DungeonManager.java

示例4: onCommand

import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
 if (cmd.getName().equalsIgnoreCase("klotentoren")) {
  sender.sendMessage("ja hoor");
  Player p = (Player) sender;
  ArmorStand armorStand = (ArmorStand) p.getLocation().getWorld().spawn(p.getLocation(), ArmorStand.class);
  ItemStack is = new ItemStack(Material.LAPIS_ORE, 64);
  armorStand.setHelmet(is);
  armorStand.setPassenger((Entity) sender);
  armorStand.setBasePlate(false);
  ArmorStand armorStand2 = (ArmorStand) p.getLocation().getWorld().spawn(p.getLocation(), ArmorStand.class);
  armorStand2.setHelmet(is);
  armorStand2.setBasePlate(false);
  ArmorStand armorStand3 = (ArmorStand) p.getLocation().getWorld().spawn(p.getLocation(), ArmorStand.class);
  armorStand3.setHelmet(is);
  armorStand3.setBasePlate(false);
  ArmorStand armorStand4 = (ArmorStand) p.getLocation().getWorld().spawn(p.getLocation(), ArmorStand.class);
  armorStand4.setHelmet(is);
  armorStand4.setBasePlate(false);
  degree = 0;
  flyingheight = 28;
  direction = false;
  rotating = false;
  uploopcounter = 0;

  Bukkit.getScheduler().scheduleSyncRepeatingTask(main.getPL(), new Runnable() {
   @Override
   public void run() {
    if (rotating == true) {
     degree++;
     degree++;
    }
    if (degree == 360 || degree > 360) {
     degree = 0;
    }
    moveEntity(armorStand, degree + 1 * 90);
    moveEntity(armorStand2, degree + 2 * 90);
    moveEntity(armorStand3, degree + 3 * 90);
    moveEntity(armorStand4, degree + 4 * 90);
   }
  }, 0, 1);

  Bukkit.getScheduler().scheduleSyncRepeatingTask(main.getPL(), new Runnable() {
   @Override
   public void run() {
    if (flyingheight == 60) {
     direction = true;
    } else if (flyingheight == 28 || flyingheight < 35) {
     direction = false;
    }
    if (direction == true) {
     rotating = true;
     flyingheight--;
     //flyingheight--;
    } else {
     smallBittUp();
    }
   }
  }, 90, 1);
 } else {}
 return false;
}
 
開發者ID:Mindgamesnl,項目名稱:UselessCode,代碼行數:62,代碼來源:DumbDropTowerTest.java


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