I am trying to give ghasts a make over and make them hard and challenging. I want to make their fireballs more explosive and possible get them to rapid fire fireballs. I know in the game you can summon fireballs with different ExplosionPower tags, but I cant seem to figure out how to edit it in code! Please help!
To change the explosion power, you can get the fireball using an EntityExplodeEvent, check if it is a fireball, cast it to fireball, and use .setYield to change the power: Code: @EventHandler public void onEntityExplode(EntityExplodeEvent event) { if (event.getEntity() instanceof Fireball) { Fireball fireball = (Fireball) event.getEntity(); fireball.setYield(10); // According to the javadoc, this is the radius } } I haven't tested it, so it might not work.
Yup that worked! For anyone else who is curious, I then made a repeating task to summon a fireball at the ghast and set its vector to that of the original fireball. @pietermantel