LuckyBlocksActionController.java 文件源码

java
阅读 49 收藏 0 点赞 0 评论 0

项目:LuckyBlocksBukkit 作者:
public void ZombieSpawn(BlockBreakEvent event){
    Location loc = event.getBlock().getLocation();
    World world = loc.getWorld();
    Zombie zombie = (Zombie)  world.spawnEntity(loc,EntityType.ZOMBIE);
    zombie.setCustomName("Bob the Zombie");
    zombie.setCustomNameVisible(true);
    zombie.setMaxHealth(90);
    zombie.setHealth(90);
    zombie.setVillager(true);
    zombie.setTarget(event.getPlayer());
    EntityEquipment zombieEquipment = zombie.getEquipment();
    zombieEquipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET));
    zombieEquipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
    zombieEquipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
    zombieEquipment.setBoots(new ItemStack(Material.GOLD_BOOTS));
    ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
    sword.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 4);
    zombieEquipment.setItemInHand(sword);
    zombieEquipment.setItemInHandDropChance(0.5F);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号