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
| const magik = magikcraft.io; | |
| function runTests() { | |
| let testCount, testRunning, asyncTest, currentTest, asyncTimeout; | |
| const tests = []; | |
| function runTest(){ | |
| if (testRunning || tests.length == 0) { | |
| return; |
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
| const store = createStore((state = { counter: 0 }, action) => { | |
| switch(action.type) { | |
| case "INCREMENT": | |
| return { counter: state.counter + 1 } | |
| case "DECREMENT": | |
| return { counter: state.counter - 1 } | |
| default: | |
| return state | |
| } | |
| }) |
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
| // Type definitions for magikcraft.io 0.9 | |
| // Project: https://github.com/Magikcraft/magikcraft.io | |
| // Definitions by: Josh Wulf <josh@magikcraft.io> | |
| // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | |
| // TypeScript Version: 2.2 | |
| type TextComponent = any; | |
| declare interface IMagikCraftAPI { | |
| getMappedItem: () => string; |
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
| // LoL! | |
| const magik = magikcraft.io; | |
| const strings = require("testing"); | |
| function BrisJS() { | |
| strings.forEach(s => magik.dixit(s)); | |
| } |
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
| updated file contentsssss |
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
| updated file contents |
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
| nothing to see |
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); |
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
| 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); |
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
| 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(); |