Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamsolodev/3f36c82436df12ace5ce760aaf973be8 to your computer and use it in GitHub Desktop.
Save hamsolodev/3f36c82436df12ace5ce760aaf973be8 to your computer and use it in GitHub Desktop.
Magikcraft Spells, by markhellewell.
const magik = magikcraft.io;
function arrow(repeats = 200, delay = 300) {
magik.dixit('Arrow!');
const sender = magik.getSender();
const arrow = magik.type("entity.Arrow").class;
const hurl = (thing) => () => sender.launchProjectile(thing)
const volley = () => magik.doNTimes(hurl(arrow), repeats, delay, null);
magik.doNTimes(volley, repeats, delay*10, null);
}
const magik = magikcraft.io;
function cl() {
const Material = magik.type('Material');
const world = magik.getSender().getWorld();
function p5() {
const x0 = looking.getX();
const y0 = looking.getY();
const z0 = looking.getZ();
function blast(X,Z, Y) {
const looking = magik.aspecto();
const location = looking;
location.setX(X);
location.setZ(Z);
world.strikeLightning(location);
let b = world.getBlockAt(location);
while(b.getType().equals(Material.AIR)){
Y--;
location.setY(Y);
b = location.getBlock();
}
world.getBlockAt(location).setType(Material.OBSIDIAN);
}
const r = 8;
const items = 40;
for(let i = 0; i < items; i++) {
const x = x0 + r * Math.cos(2 * Math.PI * i / items);
const z = z0 + r * Math.sin(2 * Math.PI * i / items);
blast(x,z,y0);
}
}
// const x = looking.getX();
// const y = looking.getY();
// const z = looking.getZ();
function blast() {
const looking = magik.aspecto();
const X = looking.getX();
const Y = looking.getY();
const Z = looking.getZ();
const location = looking;
location.setX(X + Math.random() * 10 - 5);
location.setZ(Z + Math.random() * 10 - 5);
world.strikeLightning(location);
}
magik.doNTimes(() => {
magik.doNTimes(() => {
magik.doNTimes(() => {blast()}, 15, 500)},
15)},
15, p5);
}
const magik = magikcraft.io;
function feed(playerName) {
magik.satio(playerName);
}
const magik = magikcraft.io;
function feedme() {
magik.satio();
}
const magik = magikcraft.io;
function fly(){
magik.volare();
}
const magik = magikcraft.io;
function glow(name) {
magik.radiatum(name);
}
const magik = magikcraft.io;
function sb(repeats = 200, delay = 300) {
magik.dixit('Snowball!');
const sender = magik.getSender();
const snowball = magik.type("entity.Snowball").class;
const hurl = (thing) => () => sender.launchProjectile(thing)
const volley = () => magik.doNTimes(hurl(snowball), repeats, delay, null);
magik.doNTimes(volley, repeats, delay*10, null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment