コード例 #1
0
  @Override
  public void addEquipment(World world, Random rand, int level, IEntity mob) {

    if (level == 3 && rand.nextInt(40) == 0) {
      MonsterProfile.get(MonsterProfile.POISONARCHER).addEquipment(world, rand, level, mob);
      return;
    }

    if (level > 1 && rand.nextInt(50) == 0) {
      MonsterProfile.get(MonsterProfile.MAGICARCHER).addEquipment(world, rand, level, mob);
      return;
    }

    if (level > 1 && rand.nextInt(10) == 0) {
      MonsterProfile.get(MonsterProfile.WITHER).addEquipment(world, rand, level, mob);
      return;
    }

    if (level > 0 && rand.nextInt(20) == 0) {
      MonsterProfile.get(MonsterProfile.SWORDSMAN).addEquipment(world, rand, level, mob);
      return;
    }

    MonsterProfile.get(MonsterProfile.ARCHER).addEquipment(world, rand, level, mob);
  }
コード例 #2
0
  @Override
  public void addEquipment(World world, Random rand, int level, IEntity mob) {
    ItemStack weapon =
        rand.nextInt(20) == 0
            ? ItemNovelty.getItem(ItemNovelty.VALANDRAH)
            : ItemWeapon.getSword(
                rand, level, Enchant.canEnchant(world.getDifficulty(), rand, level));

    mob.setSlot(EntityEquipmentSlot.MAINHAND, weapon);
    mob.setSlot(EntityEquipmentSlot.OFFHAND, Shield.get(rand));
    MonsterProfile.get(MonsterProfile.TALLMOB).addEquipment(world, rand, level, mob);
  }