home / skills / bdambrosio / cognitive_workbench / mc-attack

This skill lets you perform left-click style actions to attack entities or break blocks, returning success or failure.

npx playbooks add skill bdambrosio/cognitive_workbench --skill mc-attack

Review the files below or copy the command above to add this skill to your agents.

Files (2)
Skill.md
1.6 KB
---
name: mc-attack
type: python
description: "Left-click style interaction (entities or blocks). Returns success/failure"
---

# Minecraft Attack Tool

Left-click style interaction for attacking entities or breaking blocks. Returns success/failure status.

## Purpose

Combat and block breaking. Can target entities (mobs, players) or blocks depending on target specification.

## Input

- `target`: Dict with either:
  - `entity_id`: String (for entity attack)
  - `dx`, `dy`, `dz`: Floats (for block attack, world-relative offsets from agent)
    - See coordinate system documentation in jill-minecraft.yaml for details
- Exactly one targeting mode must be specified
- `value`: Ignored

## Output

Returns uniform_return format with:
- `value`: Text summary (success/failure message)
- `data`: Structured data dict (machine-readable). Key fields:
  - `success`: Boolean

## Behavior & Performance

- Entity attack: Targets specific entity by ID
- Block attack: Targets block at specified position
- Requires appropriate tool for efficient block breaking

## Guidelines

- Use entity_id for attacking mobs or players
- Use world-relative coordinates `dx, dy, dz` for block attacks (see coordinate system in jill-minecraft.yaml)
- Tool efficiency matters for block breaking (use appropriate tool)
- Multiple attacks may be needed to break blocks or defeat entities

## Usage Examples

Attack block directly south:
```json
{"type":"mc-attack","target":{"dx":0,"dy":0,"dz":1},"out":"$attack"}
```

Attack entity:
```json
{"type":"mc-attack","target":{"entity_id":"zombie_123"},"out":"$attack"}
```

Overview

This skill performs a left-click style interaction in Minecraft to attack entities or strike/break blocks. It returns a uniform success/failure result with a human-readable message and machine-readable data indicating whether the interaction succeeded.

How this skill works

You specify a single target mode: either an entity_id to attack a mob/player or world-relative coordinates (dx, dy, dz) to hit a block. The skill executes a left-click interaction at the target and returns a structured result with a boolean success flag and a short text summary. Block breaking speed depends on tool appropriateness and may require repeated attacks.

When to use it

  • Engaging a specific mob or player by ID for combat or crowd control.
  • Attempting to break or hit a block at a relative position from the agent.
  • Automating simple combat routines in scripts or task flows.
  • Triggering left-click interactions that require repeated hits (e.g., mining).
  • Testing attack mechanics or validating reach and targeting logic.

Best practices

  • Provide exactly one targeting mode: either entity_id or dx/dy/dz coordinates.
  • Use entity_id when you need to target a specific mob or player reliably.
  • Use dx, dy, dz for world-relative block targeting; consult the environment coordinate system.
  • Equip an appropriate tool before attacking blocks to improve breaking speed.
  • Allow for multiple attack calls when targeting high-health entities or hard blocks.

Example use cases

  • Attack a zombie by ID: target {"entity_id":"zombie_123"} to perform a left-click attack.
  • Break a block one block south: target {"dx":0,"dy":0,"dz":1} to strike the block.
  • In a combat loop, check success flag and repeat attack until the entity is defeated.
  • Automation script that mines multiple adjacent blocks by issuing sequential block targets.

FAQ

What input fields are required?

Provide exactly one targeting mode: either entity_id for entities or dx, dy, dz for block positions. The value field is ignored.

How do I know if the attack worked?

The skill returns a uniform result where data.success is true on success and false on failure, plus a short text summary in value.