mc-link
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

mc-link

Run minecraft commands from outside your world using only datapacks.

Important Notes:

Setup

Since mcfunction files can't use the datapack command, you need to place two commandblocks into your world for mc-link to work.

The first commandblock is set to repeat, unconditional, always active and runs this command:

execute if score mc-link:countup vars matches 39.. run datapack disable "file/mc-link-worker"

The second commandblock is faced by the first one, is set to chained, unconditional, always active and runs this command:

datapack enable "file/mc-link-worker"

If you want to be able to turn off mc-link using redstone you can set the first one to needs redstone.

Performance

Mc-link reloads a tiny datapack every two seconds to receive new commands, but minecraft reloads much more. These reloads are very noticable.

Usage

CLI

mc-link [wordname]

$ mc-link YourWorldName
Installing datapack... Ready.
> say hi
> difficulty peaceful

Typescript API

import { McLink } from "mc-link";
 
const link = new McLink("YourWorldName");
 
link.run("say hi");
link.run("difficulty peaceful");

ToDos

  • Improve Performance (Maybe file a bugreport)
  • Add ability to place setup commandblocks

Contributing

Feel free to fork and issue pull requests.

Readme

Keywords

Package Sidebar

Install

npm i mc-link

Weekly Downloads

1

Version

0.1.1

License

AGPL-3.0-or-later

Unpacked Size

14.8 kB

Total Files

15

Last publish

Collaborators

  • sebastianspeitel