mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-07-23 08:25:19 +02:00
make a blueprint for the pyramid tasks
This commit is contained in:
parent
83057cb255
commit
11db49ce78
3 changed files with 743 additions and 2 deletions
|
@ -1070,8 +1070,8 @@ export function blueprintToTask(blueprint_data, num_agents) {
|
|||
|
||||
const task = {
|
||||
type: "construction",
|
||||
goal: "Make a house with the blueprint below",
|
||||
conversation: "Let's share materials and make a house with the blueprint",
|
||||
goal: "Make a structure with the blueprint below",
|
||||
conversation: "Let's share materials and make a structure with the blueprint",
|
||||
agent_count: 2,
|
||||
blueprint: blueprint_data,
|
||||
initial_inventory: initialInventory,
|
||||
|
|
688
tasks/construction_tasks/custom/pyramid.json
Normal file
688
tasks/construction_tasks/custom/pyramid.json
Normal file
|
@ -0,0 +1,688 @@
|
|||
{
|
||||
"pyramid": {
|
||||
"type": "construction",
|
||||
"goal": "Make a structure with the blueprint below",
|
||||
"conversation": "Let's share materials and make a structure with the blueprint",
|
||||
"agent_count": 2,
|
||||
"blueprint": {
|
||||
"materials": {
|
||||
"polished_granite": 1,
|
||||
"gold_block": 27,
|
||||
"stone_bricks": 41,
|
||||
"polished_andesite": 34,
|
||||
"quartz_block": 16,
|
||||
"stone": 23,
|
||||
"polished_diorite": 21,
|
||||
"quartz_pillar": 2,
|
||||
"glowstone": 3
|
||||
},
|
||||
"levels": [
|
||||
{
|
||||
"level": 0,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-60,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"polished_granite",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"quartz_block",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"gold_block"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"gold_block"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"gold_block",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"quartz_block",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"quartz_block"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"polished_diorite",
|
||||
"stone_bricks"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"polished_diorite",
|
||||
"stone_bricks",
|
||||
"polished_andesite"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"polished_diorite",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"gold_block",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"quartz_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"gold_block"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"level": 1,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-60,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"quartz_pillar",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"quartz_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"stone",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"stone_bricks",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"polished_andesite",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"quartz_block",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"glowstone",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"quartz_block",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"stone_bricks",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"polished_andesite",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"polished_andesite",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"quartz_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"level": 2,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-60,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"quartz_pillar",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"quartz_block",
|
||||
"gold_block",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"polished_andesite",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"quartz_block",
|
||||
"polished_andesite",
|
||||
"glowstone",
|
||||
"stone_bricks",
|
||||
"quartz_block",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone_bricks",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"polished_andesite",
|
||||
"quartz_block",
|
||||
"stone_bricks",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"level": 3,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-60,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"quartz_block",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"quartz_block",
|
||||
"glowstone",
|
||||
"quartz_block",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"quartz_block",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"level": 4,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-60,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"initial_inventory": {
|
||||
"0": {
|
||||
"polished_granite": 1,
|
||||
"stone_bricks": 41,
|
||||
"quartz_block": 16,
|
||||
"polished_diorite": 21,
|
||||
"glowstone": 3
|
||||
},
|
||||
"1": {
|
||||
"gold_block": 27,
|
||||
"polished_andesite": 34,
|
||||
"stone": 23,
|
||||
"quartz_pillar": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
53
tasks/construction_tasks/get_blueprint.js
Normal file
53
tasks/construction_tasks/get_blueprint.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
import mineflayer from 'mineflayer';
|
||||
import { worldToBlueprint, blueprintToTask } from '../../src/agent/task_types/construction_tasks.js';
|
||||
import fs from 'fs';
|
||||
import { start } from 'repl';
|
||||
|
||||
const bot = mineflayer.createBot({
|
||||
host: 'localhost', // Replace with your server IP or hostname
|
||||
port: 55916, // Replace with your server port
|
||||
username: 'andy', // Replace with your bot's username
|
||||
// password: 'your_bot_password' // Only if the server has online-mode=true
|
||||
});
|
||||
|
||||
bot.on('spawn', async () => {
|
||||
console.log("Bot spawned. Starting blueprint check...");
|
||||
const startCoord = {
|
||||
x: -60,
|
||||
y: 1,
|
||||
z: 6,
|
||||
}
|
||||
bot.chat(`/tp andy ${startCoord.x} ${startCoord.y} ${startCoord.z}`);
|
||||
const yOffset = 5;
|
||||
const xOffset = 10;
|
||||
const zOffset = 10;
|
||||
|
||||
const taskFilePath = '/Users/isadorawhite/izzy_mindcraft/mindcraft/tasks/construction_tasks/custom/pyramid.json';
|
||||
const task_name = "pyramid";
|
||||
|
||||
|
||||
setTimeout(async () => {
|
||||
let task_blueprint = await worldToBlueprint(startCoord, yOffset, xOffset, zOffset, bot);
|
||||
|
||||
for (const level of task_blueprint.levels) {
|
||||
// Perform operations on each level
|
||||
console.log("Level coordinates:", level.coordinates);
|
||||
const new_coordinates = [level.coordinates[0], -60, level.coordinates[2]];
|
||||
level.coordinates = new_coordinates;
|
||||
console.log("New coordinates:", level.coordinates);
|
||||
}
|
||||
console.log("Blueprint generated:", task_blueprint.levels[0].coordinates);
|
||||
|
||||
const task = blueprintToTask(task_blueprint, 2);
|
||||
const task_collection = {}
|
||||
task_collection[task_name] = task;
|
||||
|
||||
fs.writeFileSync(taskFilePath, JSON.stringify(task_collection, null, 2), (err) => {
|
||||
if (err) {
|
||||
console.error('Error writing task to file:', err);
|
||||
} else {
|
||||
console.log('Task dumped to file successfully.');
|
||||
}
|
||||
});
|
||||
}, 5000); // Delay of 5 seconds (5000 milliseconds)
|
||||
});
|
Loading…
Add table
Reference in a new issue