-
-
Save jwulf/c19ebe872b049a227c657ce40345c71b to your computer and use it in GitHub Desktop.
The Legendary Exclusion Field™ by Ash Kyd and Josh Wulf - from Camp JS viii
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
This spell throws all entities around you, like a repulsive shield of protection. | |
**/ | |
const magik = magikcraft.io; | |
function r() { | |
const times = 5 * 1000 / 300; // 5 seconds, every 300ms | |
let n = times; | |
magik.setTimeout(shield, 300); | |
function shield() { | |
n --; | |
const location = magik.hic(); | |
const nearbyEntities = location.getWorld().getNearbyEntities(location, 8, 8, 8); | |
nearbyEntities.forEach(entity => toss(entity)); | |
if (n>0) { | |
magik.setTimeout(shield, 300) | |
} | |
} | |
} | |
function toss(entity){ | |
if (entity.getName() == magik.getSender().getName()) { | |
return; | |
} | |
var Vector = Java.type('org.bukkit.util.Vector'); | |
entity.setVelocity(new Vector(2,2,2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment