Code (Java): @EventHandler public void blockBreak(BlockBreakEvent event) { if (event.getBlock().getType().equals(Material.MOSSY_COBBLESTONE)) { Block block = event.getBlock(); block.getLocation().getWorld().strikeLightning(block.getLocation()); PigZombie pigZombie = (PigZombie) block.getWorld().spawnEntity(block.getLocation(), EntityType.PIG_ZOMBIE); pigZombie.setMaxHealth(1024); pigZombie.setCustomName(ChatColor.GOLD + "PigZombie Boss "); pigZombie.setCustomNameVisible(true); } }
Another problem being that this is done with attributes in more recent versions of the API. Additionally, @OP, please use [CODE=java][/CODE] tags to insert code into a thread and make your thread more descriptive than just a block of code. Content to read in your actual thread will be significantly more useful. https://hub.spigotmc.org/javadocs/s...#getAttribute-org.bukkit.attribute.Attribute- https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html#GENERIC_MAX_HEALTH https://hub.spigotmc.org/javadocs/s...ifier-org.bukkit.attribute.AttributeModifier-
is this giving an error? if so, go to spigot.yml to change the max health. Also, just as @md_5 said, you need to actually set the health. You're just only setting the max health instead of changing the actual health of the mob.
Top right next to unwatch thread there's options where you can edit the title and uncheck the open box to close the thread as well