Added State system,logic and commands for debugging. For setting region values. Outside of dev tools I wrote the command that the purchasing entities will call for a region

This commit is contained in:
MomokoKoigakubo
2026-09-24 00:53:19 -04:00
parent a490a05bf8
commit 9dad3c6176
11 changed files with 544 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
import { log } from "./core/log.js";
import { load } from "./save/state.js";
import { getState } from "./save/state.js";
import "./core/commands.js"
import {world} from "@minecraft/server";
log("main.js loaded)");
/*
Dynamic properties have to exist post worldLoad
1.9 -> 2.0 scripts now load before world load
Grabbed data will throw an exception
if we don't do things after worldLoad
You can't serve a pizza if you don't have a pizza
Players, entities, blocks
Time of day, Gamemode, difficulty
*/
world.afterEvents.worldLoad.subscribe(() => {
load();
console.log(JSON.stringify(getState()));
});
//good for debugging gate values
//console.log(JSON.stringify(getState()));