Prevent Damage?

Discussion in 'Plugin Development' started by Meta1203, Jan 18, 2011.

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


    I was wondering how to prevent a player from being damaged on onDamageEntity() event? Here is a snippet my code so far:
    public void onEntityDamage (EntityDamageEvent event) {
            Entity damagee = event.getEntity();
            if (damagee instanceof Player) {
                System.out.println("Player Damaged!");
                Player player = (Player)damagee;
                if (ETCPlayerListener.gods.contains(player.getName())) {
                    System.out.println("God Player Damaged!");
    I jump off a cliff and nothing happens in the output, and I get hurt as usual.
    What is wrong here?
  2. Offline


    Same problem here. Seems that falling damage is not triggered yet?!
  3. Offline


    It is not yet implemented, they are wokring on it.

    In the Meantime use SimpleGod by Silence. It does it differently, but serves the purpose for now.
  4. Offline


    Drowning damage event also wasn't triggering last I checked.
  5. Offline


    The entity damaged by block event seemed to work a few versions back, but behaves differently on current builds.
    When I have the time I'll bisect bukkit :/
  6. Offline


    Cogito (the dev currently working on this) said he's been doing a lot in regards to this. Drowning, and falling will not register in the damage events. Damage by block falling was working for me, but I didn't test it in the more recent build (tested on #81).

    I finished my plugin not long ago which used to use sethealth on damage, but I took it out since setCancelled was going to replace it anyway. It has flatfile support for permissions as well as support for GroupUsers (temporarily). I'm just waiting on those events to register properly. /advertise

    Hopefully within the next few builds it will be fixed and our plugins can work as they should.
  7. Offline


    I cannot get fall damage, drowning damage, or suffocation damage to trigger on the latest build. We shall have to wait for an update I suppose.
  8. Offline


    Since I started experimented (CB ver. 5x) it never worked properly for those events. There is a bug filed and a dev also reponded to it, so there is nothing for us to do other than wait it out.
Thread Status:
Not open for further replies.

Share This Page