Advertisement
Guest User

bark bark bark

a guest
Apr 8th, 2020
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // AWOOoooooooooo
  2. //
  3. // Just cram this in tick(event) or any other time you want to fire this bad boy off
  4.  
  5. function lycanthrope(event) {
  6.     var P = event.API.getIWorld(0).getAllPlayers()
  7.     for(var n=0;n<P.length;n++) {
  8.         var x = P[n].getX() - 1
  9.         var y = Math.ceil(P[n].getY())
  10.         var z = P[n].getZ()
  11.         var block = P[n].world.getBlock(x,y,z)
  12.         // get MC block, etc, so we can see if it's open to the sky or not
  13.         var thisMCWorld = P[n].world.getMCWorld()
  14.         var thisMCBlock = block.getMCBlock()
  15.         var thisMCBlockPos = block.getPos().getMCBlockPos()
  16.         var thisMCBlockLightLevel = thisMCWorld.func_175724_o(thisMCBlockPos) * 16.0
  17.         var isAboveground = thisMCWorld.func_175710_j(thisMCBlockPos)
  18.         var isDaytime = thisMCWorld.func_72935_r()
  19.         var shouldBurn = ((thisMCBlockLightLevel > 7) && isAboveground && isDaytime)
  20.         if(P[n].getStoreddata().has("Lycanthrope") == true && shouldBurn == true) {
  21.             if(shouldBurn == true) {
  22.                 // player burns in sunlight, just like an undead mob
  23.                 event.player.getMCEntity().func_70015_d(5)
  24.             }
  25.             // and other werewolf effects.  you can add whatever you want under here
  26.             event.player.addPotionEffect(16,2,0,false) // night vision
  27.             event.player.addPotionEffect(8,2,0,false) // leaping
  28.             event.player.addPotionEffect(1,2,0,false) // speed
  29.             // make player "kill" sheep
  30.             var sheep = P[n].rayTraceEntities(8.0,false,false)
  31.             var killedSheep = false
  32.             for(var i = 0;i<sheep.length;i++) {
  33.                 if(sheep[i].getName().indexOf("Sheep") > -1 && killedSheep == false) {
  34.                     P[n].setPos( sheep[i].getPos() )
  35.                     event.player.world.playSoundAt(sheep[i].getPos(),"minecraft:entity.sheep.death",2,1)
  36.                     sheep[i].kill()
  37.                     killedSheep = true
  38.                 }
  39.             }
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement