mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-03-28 14:56:24 +01:00
fixed merge conflicts
This commit is contained in:
parent
b064ff49eb
commit
a3c8ed7c85
2 changed files with 40 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "andy",
|
||||
|
||||
"model": "gpt-4-0125-preview",
|
||||
"model": "gpt-3.5-turbo",
|
||||
|
||||
"conversing": "You are a playful Minecraft bot named $NAME that can converse with players, see, move, mine, build, and interact with the world by using commands. Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer('playername', 3)'. This is extremely important to me, take a deep breath and have fun :)\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\nConversation Begin:",
|
||||
|
||||
|
|
|
@ -15,9 +15,42 @@ import * as mc from '../utils/mcdata.js';
|
|||
// while update functions are async, they should *not* be awaited longer than ~100ms as it will block the update loop
|
||||
// to perform longer actions, use the execute function which won't block the update loop
|
||||
const modes = [
|
||||
{
|
||||
name: 'self_preservation',
|
||||
description: 'Respond to drowning, burning, and damage at low health.',
|
||||
interrupts: ['all'],
|
||||
on: true,
|
||||
active: false,
|
||||
update: async function (agent) {
|
||||
let block = agent.bot.blockAt(agent.bot.entity.position);
|
||||
let blockAbove = agent.bot.blockAt(agent.bot.entity.position.offset(0, 1, 0));
|
||||
if (blockAbove.name === 'water' || blockAbove.name === 'flowing_water') {
|
||||
// does not call execute so does not interrupt other actions
|
||||
agent.bot.setControlState('jump', true);
|
||||
}
|
||||
if (block.name === 'lava' || block.name === 'flowing_lava' || block.name === 'fire') {
|
||||
execute(this, agent, async () => {
|
||||
let nearestWater = world.getNearestBlock(agent.bot, 'water', 20);
|
||||
if (nearestWater) {
|
||||
let pos = nearestWater.position;
|
||||
bot.pathfinder.setMovements(new pf.Movements(bot));
|
||||
await bot.pathfinder.goto(new pf.goals.GoalNear(pos.x, pos.y, pos.z, 4));
|
||||
}
|
||||
else {
|
||||
await skills.moveAway(agent.bot, 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (agent.bot.health < 5 && agent.bot.lastDamageTime < Date.now() - 3000) {
|
||||
execute(this, agent, async () => {
|
||||
await skills.moveAway(agent.bot, 20);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'cowardice',
|
||||
description: 'Automatically run away from enemies. Interrupts other actions.',
|
||||
description: 'Run away from enemies. Interrupts other actions.',
|
||||
interrupts: ['all'], // Todo: don't interrupt attack actions
|
||||
dont_interrupt: ['followPlayer'],
|
||||
on: true,
|
||||
|
@ -34,7 +67,7 @@ const modes = [
|
|||
},
|
||||
{
|
||||
name: 'self_defense',
|
||||
description: 'Automatically attack nearby enemies. Interrupts other actions.',
|
||||
description: 'Attack nearby enemies. Interrupts other actions.',
|
||||
interrupts: ['all'],
|
||||
on: true,
|
||||
active: false,
|
||||
|
@ -50,7 +83,7 @@ const modes = [
|
|||
},
|
||||
{
|
||||
name: 'hunting',
|
||||
description: 'Automatically hunt nearby animals when idle.',
|
||||
description: 'Hunt nearby animals when idle.',
|
||||
interrupts: ['defaults'],
|
||||
on: true,
|
||||
active: false,
|
||||
|
@ -66,7 +99,7 @@ const modes = [
|
|||
},
|
||||
{
|
||||
name: 'item_collecting',
|
||||
description: 'Automatically collect nearby items when idle.',
|
||||
description: 'Collect nearby items when idle.',
|
||||
interrupts: ['followPlayer'],
|
||||
on: true,
|
||||
active: false,
|
||||
|
@ -96,7 +129,7 @@ const modes = [
|
|||
},
|
||||
{
|
||||
name: 'torch_placing',
|
||||
description: 'Automatically place torches when idle and there are no torches nearby.',
|
||||
description: 'Place torches when idle and there are no torches nearby.',
|
||||
interrupts: ['followPlayer'],
|
||||
on: true,
|
||||
active: false,
|
||||
|
@ -117,7 +150,7 @@ const modes = [
|
|||
},
|
||||
{
|
||||
name: 'idle_staring',
|
||||
description: 'Non-functional animation to look around at entities when idle.',
|
||||
description: 'Animation to look around at entities when idle.',
|
||||
interrupts: [],
|
||||
on: true,
|
||||
active: false,
|
||||
|
|
Loading…
Add table
Reference in a new issue