This script was last updated for Java Edition 1.16.3 and Bedrock Edition 1.16.40.
Picture a flying three-headed monster with hundreds of health points that shoots deadly skulls at any player it sees. Well, that is exactly what the wither is! Originally introduced in Java Edition 1.4.2, the Pretty Scary Update, the wither is one of two boss mobs in the game, the other being the ender dragon. It is the only hostile mob that you can, and must, directly create, being constructed with soul sand or soul soil placed in a T shape and three wither skeleton skulls on top. One of the skulls must be the last block placed in its creation and the blocks on either side of the base soul sand must be air in order for it to spawn properly.
So why bother going through all this? Well, once you successfully kill the wither, it will drop the valuable nether star, which can be used to craft a beacon. The nether star is unique in that it cannot be destroyed by explosions and takes 10 minutes to despawn, twice as much time as for most items. The wither also drops 50 experience if you or your pet wolf kills it, or hits it up to 5 seconds before its death.
In the Java Edition, withers have 300 hit points or 150 hearts of health, making it the strongest mob in all of Minecraft. It can fire black wither skulls using its three heads, allowing to target up to three mobs at once. Its skull deal 8 hp or 4 hearts of damage across all difficulties, but on normal and hard, it can give the wither II status effect, for 10 seconds and 40 seconds respectively. The wither is also one of the only mobs capable of naturally regenerating its health on its own, capable of gaining 1 hp every second and 5 hp for every mob it kills. When its health drops below half, defined as 150 hit points or 75 hearts, it will gain a natural armor effect, giving it four armor points and making it immune to projectile damage. However, it will hover lower, making it vulnerable to melee damage. Once it is killed, it will make a loud death noise and will drop the nether star. When not attacking a mob, it will rarely fire a blue skull.
In the Bedrock Edition, withers are a much harder foe, now with a whopping 600 hit points or 300 hearts of health, the wither is much more powerful and can preform more attacks. When spawned, the sky light level drops permanently to 11 until defeated, preventing undead mobs from burning and keeping spiders aggressive. It will fly to a random location, usually high up, and start firing wither skulls at its target. Unlike java edition, it can fire blue skulls normally when attacking, usually firing them in a burst fashion. On normal and hard difficulty, it can also fire the blue skulls to locate a hidden target by blasting any blocks in the way. Unlike Java, Bedrock Edition withers cannot naturally regenerate health, which may explain their insane health. The wither skulls deal that same damage and give the same effects as on Java. When the wither drops to half health it will release a powerful explosion equivalent to its spawn explosion and will summon 3 wither skeletons on normal and 4 on hard difficulties as well as gaining its wither armor. It will start to fire its skulls faster and can use an exclusive melee dash attack, plowing through nearby blocks and damaging and knocking back nearby mobs similar to the ender dragon. Once killed, it will explode again, producing a large crater and dropping the nether star.
The Wither is completely immune to nearly all status effects, but because it is an undead mob, it is still affected by instant health and instant damage, with instant health damaging and instant damage healing the wither. When the wither kills a mob, the mob drops a wither rose, the only way to obtain it. The wither rose inflicts the Wither effect for 2 seconds on any entity (except for the wither, ender dragon, and wither skeleton).