set goal option

This commit is contained in:
Kolby Nottingham 2024-04-24 13:36:26 -07:00
parent 1f0ef465db
commit deade1aef7
3 changed files with 7 additions and 1 deletions

View file

@ -12,6 +12,8 @@
"goal_setting": "You are a Minecraft bot named $NAME that has the ability to set in-game goals that are then executed programatically. Goals must be either and item or block name or a blueprint of a specific building. Any minecraft item or block name is valid. However, only names from the following list are valid blueprints: $BLUEPRINTS. Given any recent conversation and the most recently attempted goals, set a new goal to achieve. Fromat your response as a json object with the fields \"name\" and \"quantity\". Note that the quantity for a blueprint should always be one. Example:\n```json\n{\"name\": \"iron_pickaxe\", \"quantity\": 1}```", "goal_setting": "You are a Minecraft bot named $NAME that has the ability to set in-game goals that are then executed programatically. Goals must be either and item or block name or a blueprint of a specific building. Any minecraft item or block name is valid. However, only names from the following list are valid blueprints: $BLUEPRINTS. Given any recent conversation and the most recently attempted goals, set a new goal to achieve. Fromat your response as a json object with the fields \"name\" and \"quantity\". Note that the quantity for a blueprint should always be one. Example:\n```json\n{\"name\": \"iron_pickaxe\", \"quantity\": 1}```",
"npc": { "npc": {
"do_routine": true,
"do_set_goal": true,
"goals": [ "goals": [
"wooden_pickaxe", "wooden_pickaxe",
"hole", "hole",

View file

@ -196,7 +196,7 @@ export class NPCContoller {
} }
} }
if (!acted) if (!acted && this.data.do_set_goal)
await this.setGoal(); await this.setGoal();
} }

View file

@ -5,6 +5,7 @@ export class NPCData {
this.built = {}; this.built = {};
this.home = null; this.home = null;
this.do_routine = true; this.do_routine = true;
this.do_set_goal = true;
} }
toObject() { toObject() {
@ -18,6 +19,7 @@ export class NPCData {
if (this.home) if (this.home)
obj.home = this.home; obj.home = this.home;
obj.do_routine = this.do_routine; obj.do_routine = this.do_routine;
obj.do_set_goal = this.do_set_goal;
return obj; return obj;
} }
@ -41,6 +43,8 @@ export class NPCData {
npc.home = obj.home; npc.home = obj.home;
if (obj.do_routine !== undefined) if (obj.do_routine !== undefined)
npc.do_routine = obj.do_routine; npc.do_routine = obj.do_routine;
if (obj.do_set_goal !== undefined)
npc.do_set_goal = obj.do_set_goal;
return npc; return npc;
} }
} }