[SPIGOT-7613] World#createExplosion() respects mobGriefing gamerule even if no source entity is passed Created: 13/Apr/24  Updated: 25/Dec/24  Resolved: 17/Apr/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Parker Hawke Assignee: Parker Hawke
Resolution: Fixed Votes: 0
Labels: API, bug

Version: git-Bukkit-e8f9149 (MC: 1.20.4)
Guidelines Read: Yes

 Description   

`World#createExplosion()`'s implementation uses one of two explosion types (`World.a`, unmapped enum subtype), either `MOB` or `NONE`, depending on the `breakBlocks` boolean passed to the method. If `breakBlocks` is set to true but the `mobGriefing` gamerule is set to `false` in the world, the explosion will not break any blocks because the `MOB` ExplosionSource will check for that gamerule and use `Explosion.Effect.NONE` if it is false.

The `createExplosion()` method should only respect this gamerule if a `source` entity is passed to the method. If `null`, then it is expected that blocks will break in the world if `breakBlocks` is set to true. This behaviour should be better detailed in the Bukkit Javadocs and the implementation adjusted to match the expected behaviour.


Generated at Sat Dec 13 15:20:34 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.