Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Array.prototype.getRandomElement = function() {
- return this[Math.floor(Math.random() * this.length)];
- }
- const effects = [MobEffect.jump, MobEffect.blindness, MobEffect.regeneration, MobEffect.nightVision];
- const minDur = 10;
- const maxDur = 9999;
- function useItem(x, y, z, itemId, blockId, side, itemDamage, blockDamage) {
- if (itemId==280) {
- const randomDuration = Math.floor(Math.random() * (maxDur - minDur + 1)) + minDur;
- const randomEffect = effects.getRandomElement();
- Entity.addEffect(getPlayerEnt(), randomEffect, randomDuration*20, 3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement