DevBed
A simplified implementation of the Minecraft Bedrock Scripting API. For more info, read the docs.
Usage
Quickstart
To begin, install some packages with npm i -g yo generator-minecraft-addon-devbed
or with yarn: yarn global add yo generator-minecraft-addon-devbed
Then run yo minecraft-addon-devbed
.
Manual installation
Install DevBed by running npm install devbed
or with yarn: yarn add devbed
.
Then add the following code to the top of your client.js
and server.js
files:
const bed = client
From here, you can use all of the functions offered by DevBed through the bed
object.
Migration guide
If you want to introduce DevBed into your current scripts, you can continue to use legacy code thoughout the migration.
After installing DevBed, find code in your client.js
and server.js
that looks like this:
const system = client
and replace it with something like this:
DevBedversion = major: 0 minor: 0 const bed = client const system = bedsystem
You should only set the version if your legacy scripts break because of the migration.
Practical Example
With DevBed
const bed = client bed bed
Without DevBed
const clientSystem = client clientSystem { const eventDataDefaults = narf: false clientSystem const scriptLoggerConfig = clientSystem scriptLoggerConfigdatalog_errors = true scriptLoggerConfigdatalog_information = true scriptLoggerConfigdatalog_warnings = true clientSystem} let firstTick = true clientSystem { if firstTick firstTick = false let chatEventData = clientSystem chatEventDatadatamessage = "What are we going to do tonight Server?" clientSystem let pinkyEventData = clientSystem pinkyEventDatadatanarf = true clientSystem }