Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. @Override
  2. public void onLivingUpdate() {
  3. super.onLivingUpdate();
  4. if (this.motionX > -1.2F && this.motionX < 1.2F){
  5. this.motionX *= 1.2F;
  6. }
  7. if (this.motionZ > -1.2F && this.motionZ < 1.2F){
  8. this.motionZ *= 1.2F;
  9. }
  10. if (this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL)
  11. this.despawnEntity();
  12. this.musicTick--;
  13. if (this.musicTick == 0){
  14. this.musicTick = 233;
  15. this.playSound("nevermine:MusicCrystocore", 3.00F, 1.0F);
  16. }
  17. this.stateSwitch--;
  18. if (this.stateSwitch == 0){
  19. this.state = rand.nextInt(6);
  20. this.stateSwitch = 180;
  21.  
  22. if (!this.worldObj.isRemote)
  23. for (EntityPlayer e : (List<EntityPlayer>) this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(60, 60, 60))){
  24. if (this.state == 1)
  25. e.addPotionEffect(new PotionEffect(Potion.poison.id, 180, 1));
  26. else if (this.state == 2)
  27. e.addPotionEffect(new PotionEffect(Potion.blindness.id, 180, 2));
  28. else if (this.state == 3)
  29. e.addPotionEffect(new PotionEffect(Potion.weakness.id, 180, 1));
  30. else if (this.state == 4)
  31. e.addPotionEffect(new PotionEffect(Potion.confusion.id, 180, 10));
  32. else if (this.state == 5)
  33. e.addPotionEffect(new PotionEffect(Potion.wither.id, 180, 1));
  34. else
  35. e.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 180, 1));
  36. }
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement