As a user I can add a module to my package.json, save it, then run spells from it directly in Minecraft with a command like /call <module_name> <exported_entrypoint> - eg: /call mct1 start.
I can also install and run mini-games from packages without writing any additional spell code to load them.
Background
At the moment you can import packages, but you still have to write a spell to use anything from the package. Developers currently cannot write packages of reusable spells that require nothing more than importing. With this feature, developers can write packages of spells and mini-games that end-users can import and cast "out of the box".
Feature Description
Spell packages
Package interface definition
This is a specification for exporting spells from a package, and a wrapper method to call those exported entry points. A package of reusable spells must export spells:
A Java plugin command /call to call the spell - it will be /cast call mct1 start in the first cut.
Fusing the spells into the users' spells, so they don't need namespacing to cast them.
Acceptance Criteria
A module with a conforming spells export can be added to the package.json, and then /cast call <modulename>:<spell> and /cast call <modulename> <spell> execute the spell.
/cast call <modulename> <spell> <arg1> <arg2> passes the arguments through to the exported spell.
User Story
As a user I can add a module to my
package.json
, save it, then run spells from it directly in Minecraft with a command like/call <module_name> <exported_entrypoint>
- eg:/call mct1 start
.I can also install and run mini-games from packages without writing any additional spell code to load them.
Background
At the moment you can import packages, but you still have to write a spell to use anything from the package. Developers currently cannot write packages of reusable spells that require nothing more than importing. With this feature, developers can write packages of spells and mini-games that end-users can import and cast "out of the box".
Feature Description
Spell packages
Package interface definition
This is a specification for exporting spells from a package, and a wrapper method to call those exported entry points. A package of reusable spells must export
spells
:Calling spells from a spell package
A prototype call spell can work like this:
It is used like this:
/cast call mct1 start
. An alternative syntax is:/cast call mct1:start
or/cast call mct1.start
.The implementation for this is:
[TODO - In or out of scope?] A further consideration is passing further arguments through to the exported spell, for example:
/cast call sitapati lstrike <playername>
Inspecting a spell (or mini-game) package
Packages can be inspected for the spells they contain like this:
Mini-game packages
This is a specification for mini-game packages.
Naming convention
They should be named
magikcraft-minigame-*
.Mini-game package interface definition
A mini-game package must export:
It can optionally export additional entrypoints, but the
spells._default
export is mandatory, and should start the game.Loading a mini-game package
The following spell will load a mini-game package that conforms to this specification:
Out of Scope
Out of scope for the initial implementation are:
/call
to call the spell - it will be/cast call mct1 start
in the first cut.Acceptance Criteria
A module with a conforming
spells
export can be added to thepackage.json
, and then/cast call <modulename>:<spell>
and/cast call <modulename> <spell>
execute the spell./cast call <modulename> <spell> <arg1> <arg2>
passes the arguments through to the exported spell.User Acceptance Test Plan
Here is the process for testing this feature:
End-User Documentation
[Docs that can be copypasta to the user docs]