Skip to content

Interactive Minigames and Manual Crafting

CraftingEngine elevates crafting from passive waiting into skillful gameplay. Using Manual Action and Minigame stages, players actively interact with the Minecraft world using rhythmic strikes, timing gauges, and momentum meters rendered directly on their Action Bar and floating holograms.


1. Manual Action Crafting (mode: "MANUAL_ACTION")

Manual action crafting requires physical player clicks on the workstation block using the required tool:

stages:
- id: "folding_steel"
mode: "MANUAL_ACTION"
action_type: "LEFT_CLICK_BLOCK" # LEFT_CLICK_BLOCK | RIGHT_CLICK_BLOCK
required_strikes: 6
cooldown_ticks: 12 # Minimum time (ticks) between strikes
timeout: "15s" # Max time allowed before abandonment/failure
# Sound, particles, and tool durability applied per hit
on_action:
- action: "play_sound(block.anvil.use, 1.0, 1.2)"
- action: "spawn_particle(CRIT, 8, 0.2, 0.4, 0.2)"
- action: "damage_tool(1)"

Key Parameters:

  • action_type: LEFT_CLICK_BLOCK (strike) or RIGHT_CLICK_BLOCK (interact/quench).
  • required_strikes: Total successful actions needed to complete the stage.
  • cooldown_ticks: Enforces a physical rhythm. Strikes made faster than the cooldown are ignored or trigger a hollow click warning.
  • timeout: Time window to deliver all strikes.

2. Interactive Minigame Archetypes (mode: "MINIGAME")

CraftingEngine features built-in arcade-style minigame mechanics rendered via the player’s Action Bar:

[Momentum Gauge]
Action Bar: [======||||||||||||||..........] 62% (Target: 70% - 90%)
[Sweet-Spot Timing Bar]
Action Bar: [.......| [ SWEET SPOT ] |.......] <-- Strike on Center!

A. Momentum Maintenance (MOMENTUM_MAINTENANCE)

Players must continuously strike or right-click to keep a momentum gauge within a target zone (e.g. 70% to 90%) for a set duration. Natural physics decay pulls the meter down:

stages:
- id: "bellows_pumping"
mode: "MINIGAME"
minigame:
type: "MOMENTUM_MAINTENANCE"
duration_ticks: 100 # 5 seconds of maintenance required
initial_value: 20.0
max_value: 100.0
target_zone:
min: 65.0
max: 85.0
physics:
decay_per_tick: 0.8
boost_per_click: 12.0
hud:
title: "<gradient:#ff9800:#f44336><b>Bellows Pressure:</b></gradient>"
filled_char: "|"
empty_char: "."
bar_length: 24

B. Timing Sweet Spot (TIMING_SWEET_SPOT)

A cursor oscillates back and forth across the player’s Action Bar. The player must click when the cursor aligns with the sweet spot:

stages:
- id: "tempering_quench"
mode: "MINIGAME"
minigame:
type: "TIMING_SWEET_SPOT"
speed_ticks: 2 # Cursor movement speed
sweet_spot_width: 4
required_hits: 3
failure_transition: "cracked_blade"
on_sweet_spot_hit:
- action: "play_sound(entity.experience_orb.pickup, 1.0, 1.5)"
- action: "spawn_particle(VILLAGER_HAPPY, 10, 0.3, 0.3, 0.3)"

3. Dynamic Quality & Score Modifiers

Minigames track player performance (e.g. strike precision, sweet-spot accuracy, reaction delays). The final computed score directly affects the craft:

  • Flawless Play (90%+ Score): Elevates the recipe output to Masterwork Tier, attaching extra attack damage, unique particle trails, or higher durability.
  • Mediocre Play (50%-89% Score): Produces the standard item.
  • Poor Play (<50% Score): Reduces output durability or triggers a failure transition.

Next Steps

  • Holograms & Displays - Configure floating progress meters above manual crafting stations.
  • Lua Scripting - Create custom script-driven minigames using the Lua engine.