Making Projectiles Not Cause Invincibility Frames

Discussion in 'Plugin Development' started by BB_Blocks, Oct 12, 2020.

  1. Offline

    BB_Blocks

    I am aware of entity.setNoDamageTicks(0); and while I'm sure that works But I've put it about everywhere and had it print getNoDamageTicks() to console which comes up 0. Please help.
     
  2. Offline

    Shqep

    It's easier and simpler for others to help if you paste your current code by the way.
    But taking from what you said, and Minecraft resets the no damage ticks after the event is run. So by delaying the .setNoDamageTicks by 1 tick, invincibility frames are virtually gone, except for that 1 tick when the damage is dealt.

    Code:Java
    1. new BukkitRunnable {
    2. public void run() {
    3. lmaourentityherexdxd.setNoDamageTicks(0);
    4. }
    5. }.runTaskLater(youknowtherulesandsodoi, 1);


    Considering you know how to do basic stuff, I assume you already know where to put this runnable.
     

Share This Page