Repository
Current version released
2 years ago
Dependencies
deno.land/x
Versions
DenoCraft
A library to control special structures on the ReplCraft Minecraft server
Motivation
This library was inspired by SirLennox/ReplCraft, and aims to be a more complete implementation of a ReplCraft client, compared to the official library.
Getting started
Simply include the replcraft
library inside of your Deno project.
Connecting to the server
import { Client } from "https://deno.land/x/replcraft/mod.ts";
const client = new Client();
await client.connect({
token: Token.from("<your token>")
});
Placing a block
Note: The block has to be inside of the structure’s chest.
import { Client, Location, Block } from "https://deno.land/x/replcraft/mod.ts";
...
client.setBlock(Location.from(0, 0, 0)), Block.from("minecraft:cobblestone"));
Responding to transactions
...
client.on("transaction", async transaction => {
await transaction.tell(`Hello, ${transaction.player.name}!`);
transaction.accept();
});
A few other examples are located inside of the examples
folder.