peacestorm

Player.addRandomEffect

Apr 17th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const effects = [MobEffect.jump, MobEffect.blindness, MobEffect.regeneration, MobEffect.nightVision];
  2. const minDur = 10;
  3. const maxDur = 9999;
  4.  
  5. //CONFIGURATION FOR RANDOM EFFECTS ^^^^^^
  6.  
  7. Player.addRandomEffect = function() {
  8.     const randomDuration = Math.floor(Math.random() * (maxDur - minDur + 1)) + minDur;
  9.     const randomEffect = effects.getRandomElement();
  10.     Entity.addEffect(getPlayerEnt(), randomEffect, randomDuration*20, 3);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment