A utility library to streamline the development process for Minecraft Bedrock's Script API, providing essential tools for vector operations, polyfills, and time measurements.
applyImpulse
: Apply an impulse to a player.console.log
to display messages in the chat as well.begin(operation:string)
: Begin a timing operation.end()
: Conclude the timing operation.npm install @bedrock-oss/bedrock-boost
import { Vec3 } from "@bedrock-oss/bedrock-boost";
import { world } from "@minecraft/server";
world.beforeEvents.itemUse.subscribe((event) => {
event.source.applyImpulse(Vec3.from(event.source.getViewDirection()).setY(0).normalize().multiply(2));
})
import { Direction, world } from "@minecraft/server";
import { Vec3 } from "@bedrock-oss/bedrock-boost";
import "@bedrock-oss/bedrock-boost/playerPolyfill"
world.getAllPlayers().forEach(player => {
// Apply an impulse to the player
player.applyImpulse(Vec3.from(Direction.Up).multiply(2));
});
import "@bedrock-oss/bedrock-boost/consolePolyfill"
// Log messages in the game world
console.log("Hello, Minecraft World!");
import { Timings } from "@bedrock-oss/bedrock-boost"
Timings.begin("big operation 1");
// Some operations...
// Beginning another operation will automatically end the previous one
Timings.begin("big operation 2");
// Some operations...
Timings.end();
Feel free to raise an issue or submit a pull request if you have any improvements or features to suggest.
This project is licensed under the MIT License.