To report an issue or make a feature request, see the Issues page.
Magikcraft is the world's most innovative platform for coding JavaScript in Minecraft.
Check out the Magikcraft website and the Magikcraft YouTube channel.
These release notes are updated with new releases. Star this repo to get notifications when it is updated.
We changed the spell syncing mechanism from subscription to polling. Intermittently, spell syncing fails. The workaround has been to disconnect from the server and then reconnect. We have not been able to reliably reproduce this issue to debug it. We're hoping that polling causes this issue to disappear. If you encounter it, please comment on Issue #37.
We have a new lobby as the default spawn location.
We have a beta test version of Minecraft for Type 1 Diabetes. You can sign up for the beta at www.mct1.io.
As a user I can use memento remember things, and get kicked from the server, and reconnect and still have my memories.
magik.memento
now uses the new durablePlayerMap
as it's backing. This means that your memories do not disappear when you quit, or are kicked from the server. They will disappear when the server is updated. We'll get that fixed soon, but it's not there yet.
The feature was tracked in Issue #19
You can now watch videos in the Magikcraft Play App. There is a video tab that you can access here: https://play.magikcraft.io/videos.
/npm install ${package}
Video of the feature: https://www.youtube.com/watch?v=7tdhMNC0Fxc.
You can now run /npm install <package>
to install an npm package in Minecraft on a Magikcraft server.
To have packages persistently installed, use the -S
or --save
switch
Here are the variations of the /npm
command in Magikcraft:
/npm update
- deletes your node_modules
directory and reinstalls it from your package.json
./npm install
- same effect as /npm update
./npm install ${package_name}
- installs ${package_name}
for you but does not change your package.json
./npm i -S ${package_name}
or /npm install --save ${package_name}
- installs ${package_name}
and updates your package.json
file.playerMap
, durablePlayerMap
and globalMap
The Magikcraft API now exposes HashMaps that can be used by your code to store global state in your JavaScript engine, including between reloads of the JavaScript engine, or even between user sessions.
The magik.playerMap
is a Java HashMap with get
, put
, containsKey
, and clear
methods. Refer to the Javadoc for HashMap for more details.
The playerMap
is useful for storing state between invocations of spells. Examples of this include things like references to interface elements like magik.Bars
, or a game score. As well as being durable between invocations of spells, it is durable between engine reloads. This means that you can install new packages, and any state you have stored in playerMap
will still be there.
The magik.durablePlayerMap
HashMap takes this one step further. It is durable between sessions (but not between server reboots!). This means that you can store things like locations in it, log out, and they will be there the next time you log on. At a point in the future we will back this with a persistence store that survives server reboots - but for now it relies on the server process memory; so it is durable only for the life-time of the server process.
The magik.globalMap
HashMap is a ConcurrentHashMap that is accessible from all JavaScript engines. This means you can use it to store globally-shared state - for example, a shared game state. We recommend that you use namespaced keys like 'sitapati.game.border.progress'
.
Here is a pair of example spells that use magik.durablePlayerMap
to remember locations, even when you quit and return to the server:
rem.js - remember this place, optionally with a name
/**
* A persistent memory spell that uses magik.playerMap
*
* This means you can remember things even when you leave the server and come back!
*
* Usage:
* `/cast rem` -- remember this place as the default place
* `/cast rem <name>` -- remember this place as the name you give
*/
const magik = magikcraft.io;
function rem(key="here") {
const here = magik.hic();
magik.durablePlayerMap.put(`memory.${key}`, here);
magik.dixit(`Remembered this place as "${key}"`);
}
mer.js - teleport to a remembered location
/**
* Teleport to somewhere remembered using magik.playerMap
*
* This means you can remember things even when you leave the server and come back!
*
* Usage:
* `/cast mer` -- teleport to the default remembered place
* `/cast mer <name>` -- teleport to a named remembered place
*/
const magik = magikcraft.io;
function mer(key="here") {
if (!magik.durablePlayerMap.containsKey(`memory.${key}`)) {
magik.dixit(`I don't remember a place "${key}`);
return;
}
const here = magik.durablePlayerMap.get(`memory.${key}`);
magik.ianuae(here);
}
Border Minecraft is a minigame that illustrates the use of these new features, as well as the eventbus
for pub-sub communication between players' JavaScript engines.
magik.clearTimeout()
now cancels a timeout task created with magik.setTimeout()
. Prior to this release it did not cancel the task. For an example of magik.setTimeout()
and magik.clearTimeout()
, see runTests.js.magik.urlencode()
URL encodes a string. It is based on this urlencode code, with the caveat that only UTF8 is supported in the 1.1.16 release. EventEmitter
class is available in global scope. It is based on Oliver Caldwall's EventEmitter. Here is an example of using it in your own code:const magik = magikcraft.io;
function eeTest() {
const e = new EventEmitter();
e.on('_event', data => {
magik.dixit(`Event triggered with ${data}`);
});
e.emit('_event', 'test data');
}
npm
to use yarn
instead, to work around https://github.com/npm/npm/issues/18178. Packages installed from GitHub repos now reliably update. /magikcraft
command in Minecraft reports the version at the time that the server is started, even when the API has been updated during the server's lifetime.To view the current versions of a Magikcraft server, use the command /magikcraft
.
Internal changes to better support dynamic updating of the Magikcraft API. There is no user-visible impact at this time. We're working on a workaround for https://github.com/npm/npm/issues/18178 at the moment.
Eventbus: The global eventbus
object, which allows pub/sub communication between JS Engines, is re-enabled. The eventbus can be used to make spells that share player locations (for example, to let you publish your location for others to teleport to you) or shared state like a game score. See the See the README file for magikcraft-lore-core
for an example of the eventbus.
JSON Marshalling methods: toJSON
and fromJSON
methods added to the Magikcraft API. These methods marshall a BukkitLocation to and from JSON. See the README file for the magikcraft-lore-core
for an example use of these methods.
The Magikcraft Bar package is now part of the Magikcraft organisation on GitHub. Create cool interface bars with ease using this package.
Cause: EventEmitters were limited on the GraphQL server pub-sub system.
Consequence: After a certain number of users connected, spell syncing would stop and you saving spells in the Play App had no effect in Minecraft.
Fix: The EventEmitter limit was raised to Infinity!
Result: Spell syncing should now work reliably. When you save a spell in the Play App, it should be available immediately in Minecraft for you to cast it.