mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-22 06:02:07 +02:00
set goal option
This commit is contained in:
parent
1f0ef465db
commit
deade1aef7
3 changed files with 7 additions and 1 deletions
|
@ -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}```",
|
||||
|
||||
"npc": {
|
||||
"do_routine": true,
|
||||
"do_set_goal": true,
|
||||
"goals": [
|
||||
"wooden_pickaxe",
|
||||
"hole",
|
||||
|
|
|
@ -196,7 +196,7 @@ export class NPCContoller {
|
|||
}
|
||||
}
|
||||
|
||||
if (!acted)
|
||||
if (!acted && this.data.do_set_goal)
|
||||
await this.setGoal();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ export class NPCData {
|
|||
this.built = {};
|
||||
this.home = null;
|
||||
this.do_routine = true;
|
||||
this.do_set_goal = true;
|
||||
}
|
||||
|
||||
toObject() {
|
||||
|
@ -18,6 +19,7 @@ export class NPCData {
|
|||
if (this.home)
|
||||
obj.home = this.home;
|
||||
obj.do_routine = this.do_routine;
|
||||
obj.do_set_goal = this.do_set_goal;
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
@ -41,6 +43,8 @@ export class NPCData {
|
|||
npc.home = obj.home;
|
||||
if (obj.do_routine !== undefined)
|
||||
npc.do_routine = obj.do_routine;
|
||||
if (obj.do_set_goal !== undefined)
|
||||
npc.do_set_goal = obj.do_set_goal;
|
||||
return npc;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue