Advertisement
james1bow

Untitled

Jul 2nd, 2023
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. //option 1
  2.  
  3. public void Npcdamage(NpcDamageEvent Evt){
  4.     //all code for damage here
  5. }
  6.  
  7.  
  8. //option 2
  9.  
  10. public void NpcDamageNotFromPlayer(NpcDamageEvent Evt){
  11.     //return if it is damage caused by player
  12. }
  13.  
  14.  
  15. public void NpcDamageFromPlayer(NpcDamageEvent Evt){
  16.     //return if it isnt damage caused by player
  17. }
  18.  
  19. // option 3
  20.  
  21. public void Npcdamage(NpcDamageEvent Evt){
  22.     if(playerdamage){
  23.         npcdamageplayer(player);
  24.     }else{
  25.         npcdamageelse();
  26.     }
  27. }
  28.  
  29. public void npcdamageplayer(Player player){
  30.     //code for damage to npc from player
  31. }
  32.  
  33. public void npcdamageelse(){
  34.     //code for damage to npc other than player
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement