Advertisement
spacechase0

Untitled

Jun 24th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. // Swings per second
  2. As fast as you can click?
  3.  
  4.  
  5.  
  6. // Invulnerability
  7. maxHurtResistance = 20
  8. // It looks like you can get hurt again before the half way point if it does more damage than the previous attack
  9. // It doesn't reset the invuln. timer though
  10.  
  11.  
  12.  
  13. // Knockback on attack
  14. knockback = 0
  15. if ( target instanceof EntityLiving )
  16. {
  17.     // ...
  18.     knockback += Knockback enchantment level
  19. }
  20. if ( sprinting )
  21. {
  22.     knockback += 1
  23. }
  24.  
  25. if ( total damage > 0 )
  26. {
  27.     // ...
  28.     // If entity's NBT tag "Invulnerable" is true, there will be no knockback
  29.     // No knockback for the enderdragon
  30.     // No knockback for the wither from arrows in the second stage
  31.     // Probably more exceptions as well
  32.     if ( entity can be knocked back for this damage source )
  33.     {
  34.         x velocity += attacker direction * knockback * 0.5f
  35.         y velocity += 0.1
  36.         z velocity += attacker direction * knockback * 0.5f
  37.        
  38.         x velocity *= 0.6;
  39.         z velocity *= 0.6;
  40.     }
  41.     // ...
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement