Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7613

World#createExplosion() respects mobGriefing gamerule even if no source entity is passed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • git-Bukkit-e8f9149 (MC: 1.20.4)
    • Yes

      `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.

            2008Choco Parker Hawke
            2008Choco Parker Hawke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: