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

Setting EntityExplodeEvent yield to 0.0, still causes blocks to drop.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Windows 10 Pro

      Java 8u211

      If you require more information about the environment then comment, but I highly doubt you require more than that.

    • CraftBukkit version git-Spigot-d05d3c1-a2275f1 (MC: 1.14.3) (Implementing API version 1.14.3-R0.1-SNAPSHOT)
    • (Towny),
    • Yes

      So, we are listenting to an EntityExplodeEvent, then place down TNT and let it blow.

      You will notice that event if you set the yield in the event to 0.0, blocks still drop, although a yield multiplicator of 0 should be 0 I mean x*0=0

      I made example code below to test this, but this is mainly an issue in Towny, which has a block regeneration feature that needs to be fixed, since currently it allows for duplication, we did find a hotfix which is just setting it to a material that does have any drops (AIR).

       

      An example Listener (I was too lazy to compile a plugin)

       

      @EventHandler(ignoreCancelled = true)
      public void onEntityExplode(EntityExplodeEvent event) {
          event.setYield(0.0F);
      }
      

       

            Unassigned Unassigned
            Articdive Articdive
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: