
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
SPU is believed to be the abbreviation of SPU Performs Updating. It's a npm package that provides method to update Minecraft: Java Edition commands.
You can use SPU to update your Minecraft commands via the official website, the CLI (command line interface) or importing it to your project.
Open the official website.
The website is built with Angular and hosted on GitHub.
That's all.
npm i spu -g
spu <from> <to>.
<from>: The version of the input command. e.g. 12 stands for Minecraft: Java Edition 1.12. Should be one of the following values: 8, 9, 11, 12 and 13.<to>: The version of the output command. e.g. 12 stands for Minecraft: Java Edition 1.12. Should be one of the following values: 9, 11, 12, 13 and 14. Should be greater than <from>.I will enable the CLI to update whole mcfunction files if anyone requests. Feel free to open an issue!
npm i spu
import { update } from 'spu'
update(commands: string[], from: number, to: number) => { commands: string[], logs: string[], state: 'success' | 'warning' | 'error'}
e.g.
update(['/kill'], 12, 13) // { commands: ['/kill @s'], ... }
update(['setblock ~ ~ ~ minecraft:sign 0 replace'], 12, 14) // { commands: ['setblock ~ ~ ~ minecraft:oak_sign replace'], ... }
src: Source code written in TypeScript.lib: Output JavaScript files.The WheelChief system will try to parse your command(s) when you called 'update()'. All commands is stored in a CmdNode, whose format is very similiar to the format of the commands.json file that data generator provides:
interface CmdNode {
type: 'root' | 'literal' | 'argument'
children?: { [nodeName: string]: CmdNode }
parser?: string
properties?: { [propertyName: string]: any }
updater?: string
executable?: boolean
redirect?: string[]
spu_script?: string
}
e.g. The input is foobar @a {baz:qux} and it can be parsed in the following nodes:
{
type: 'root',
children: {
foobar: {
type: 'literal',
children: {
entity: {
type: 'argument',
parser: 'minecraft:entity',
properties: {
amount: 'multiple',
type: 'entities'
},
children: {
nbt: {
type: 'argument',
parser: 'minecraft:nbt',
updater: 'spgoding:entity_nbt',
executable: true,
spu_script: '%0 $setNbtToSelector%1%2'
}
}
}
}
}
}
}
And then the WheelChief will return this (if no updater is specific in the CmdNode, the WheelChief will store its parser in updater):
{
command: {
args: [
{ value: 'foobar', updater: undefined },
{ value: '@a', updater: 'minecraft:entity' },
{ value: '{baz:qux}', updater: 'spgoding:entity_nbt' }
],
spu_script: '%0 $setNbtToSelector%1%2'
},
...
}
The WheelChief will update every argument according to its updater. All updaters are defined in src/utils/wheel_chief/updater.ts and src/**to**/updater.ts. After updating all arguments we will get this (well, it just adds some quotes in this example):
{
command: {
args: [
{ value: 'foobar', updater: undefined },
{ value: '@a', updater: 'minecraft:entity' },
{ value: '{baz:"qux"}', updater: 'spgoding:entity_nbt' }
],
spu_script: '%0 $setNbtToSelector%1%2'
},
...
}
Finally the spu_script will be executed. %0 will be replaced with the first argument of the command(args[0].value), %1 will be the second(args[1].value), and so on. A token that begins with $ will be executed as a function with following %n as its parameter(s). So finally you will get foobar @a[nbt={baz:"qux"}].
I'm thrilled to hear that you'd like to contribute to this project. It's no doubt that spu will be better with your help!
Fork this this repo and clone it to your local.
Install dependencies.
npm i
Edit files in ./src.
If you add new features, it's strongly recommend to write tests for them. All tests should be put under ./src/test.
Commit and push your changes.
Open a Pull Request. The circle ci will build and test your changes automatically.
There must be lots of mistakes and bad practice in this repository. If you find something not good or not sure whether it's not good, please don't hesitate to tell me!
FAQs
A npm package that provides method to update Minecraft commands.
We found that spu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.