Entity Damage By Block Event: thread number 2!

Discussion in 'Plugin Development' started by CorrieKay, Jun 8, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    CorrieKay

    Okay, so since the bug report has yet to been confirmed, i decided to try and figure out whats going on myself.

    I was prepping to get deep into the bukkit/server code and find out why event.getDamager() was returning null whenever lava damages a player. Well i did some preliminary exploring just before attempting to dive into code, and i found out... Hey, EDBBE's dont get thrown when youre suffocating in a block, or drowning! what gives?

    So not only does the damaging block return null (if its lava) but i cant seem to think up any other use for this event other than lava... I figured it was for suffocating, burning (catches for lava, but not for flames), and possibly TNT (but that doesnt get caught either)

    ...so wtf is EntityDamageByBlockEvent used for..?
     
    ZeusAllMighty11 likes this.
  2. Offline

    obnoxint

    Cacti. Besides that I'm not sure. I agree that it's confusing. You should note this on http://leaky.bukkit.org if such a ticket doesn't exist yet.
     
  3. Offline

    CorrieKay

    i reported it as a bug about a week and a half ago.

    Lolwut, really? entity and entity living can cause damage by block? thats silly.

    also, i stood next to an exploding tnt and the event never fired off :eek:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  4. Offline

    obnoxint

    That's not really a long time, but it concerns me that it hasn't even been assigned yet. I voted the issue up.

    This is normal, because primed TNT is an Entity.
     
  5. Offline

    CorrieKay

    well why does entity, and entity living both throw the damage by block event? also explosions?
     
  6. Offline

    obnoxint

    Good question. Next question!
     
  7. CorrieKay I grep'ed (you don't know what I mean? http://en.wikipedia.org/wiki/Grep ;)), I didn't analyze... ;)
    So I would think Entity and EntityLiving can call the event if something calls the corresponding function. Now let's start analyzing...
    Entity calls the function... It gives null as damager (just what you told ... ;)) and itself as damagee... Now we could start searching for every call of net.minecraft.server.Entity.aQ() to see what's really calling the event, but that's not needed here, cause the damage cause is always EntityDamageEvent.DamageCause.LAVA so I'llbet aQ() is called whenever the entity gets damage cause he'sinside of lava... ;)
     
  8. Offline

    CorrieKay

    ferrybig and V10lator like this.
Thread Status:
Not open for further replies.

Share This Page