Getting it into your agent
There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.
Wrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/thinktidevibes/2d-survival-multiplayer-game/resources)<a href="https://agentmods.dev/rules/thinktidevibes/2d-survival-multiplayer-game/resources"><img src="https://agentmods.dev/badge/rules/thinktidevibes/2d-survival-multiplayer-game/resources.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00015 | $0.08008 |
| Opus 5 | $0.00008 | $0.04004 |
| Sonnet 5 | $0.00003 | $0.01602 |
| Haiku 4.5 | $0.00002 | $0.00801 |
Grade A, and why
resources scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 520 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Guide: Adding New Resources and Nodes
This guide outlines the steps required to add new consumable resources (like Pumpkins) or gatherable nodes (like Metal Ore) to the 2D Survival Multiplayer game. Follow these steps to ensure consistency with the existing architecture.
General Workflow
- Define Data (Server): Add necessary item definitions and entity table structures.
- Implement Logic (Server): Create server-side reducers for interaction, harvesting, spawning, and respawning.
- Integrate (Server): Update server logic (seeding, respawning) to include the new resource.
- Generate Bindings (CLI): Run
spacetime generatebefore making client-side changes that depend on new server types or reducers. - Add Assets (Client): Place images for the resource doodad and its corresponding item.
- Client-Side State Management:
- Update
useSpacetimeTables.tsto manage the new entity's state. - Update
App.tsxto fetch and pass the new entity's data. - Update
GameScreen.tsxto receive and pass down the new entity's data.
- Update
- Client Rendering & Logic (Client):
- Create rendering utilities (e.g.,
pumpkinRenderingUtils.ts) including image preloading. - Update type guards (
typeGuards.ts). - Update entity filtering (
useEntityFiltering.ts). - Integrate into the main rendering loop (
GameCanvas.tsx). - Update interaction finding (
useInteractionFinder.ts). - Update interaction labels (
labelRenderingUtils.ts). - Update input handling (
useInputHandler.ts) to call server reducers. - Update item icon mapping (
itemIconUtils.ts).
- Create rendering utilities (e.g.,
- Testing: Test spawning, interaction/harvesting, item yield, respawning, and UI rendering thoroughly.
Adding a Consumable Resource (e.g., Pumpkin)
This resource type is picked up directly by the player, disappears, and respawns after a timer. It yields an item (e.g., "Pumpkin" item).
Server (server/)
- Define Item:
- In
src/items_database.rs, within theget_item_definitions()function's returned vector, add anItemDefinitionfor the yielded item (e.g., "Pumpkin").ItemDefinition { id: 0, // Will be auto-assigned name: "Pumpkin".to_string(), description: "A ripe pumpkin, good for eating or crafting.".to_string(), category: ItemCategory::Consumable, // Or ItemCategory::Material if not directly edible icon_asset_name: "pumpkin.png".to_string(), // Matches asset in client/src/assets/items/ is_stackable: true, stack_size: 10, // ... other fields as necessary damage: None, is_equippable: false, equipment_slot_type: None, fuel_burn_duration_secs: None, }
- In
- Create Resource Module:
- Create a new file:
src/pumpkin.rs.
- Create a new file:
- Define Entity Struct (
src/pumpkin.rs):- Define the
Pumpkinstruct:use spacetimedb::{table, ReducerContext, Identity, Timestamp, log}; use crate::collectible_resources::{validate_player_resource_interaction, collect_resource_and_schedule_respawn, BASE_RESOURCE_RADIUS, PLAYER_RESOURCE_INTERACTION_DISTANCE_SQUARED}; use crate::TILE_SIZE_PX; // If needed for positioning logic, though not directly for basic consumable #[table(name = pumpkin, public)] #[derive(Clone, Debug)] pub struct Pumpkin { #[primary_key] #[auto_inc] pub id: u64, pub pos_x: f32, pub pos_y: f32, pub chunk_index: u32, pub respawn_at: Option<Timestamp>, } // Constants pub const PUMPKIN_YIELD_ITEM_NAME: &str = "Pumpkin"; // Name of the item defined in items_database.rs pub const PUMPKIN_YIELD_AMOUNT: u32 = 1; pub const PUMPKIN_RESPAWN_TIME_SECS: u64 = 180; // Example: 3 minutes pub const PUMPKIN_RADIUS: f32 = BASE_RESOURCE_RADIUS; // Or a custom radius // Spawning density and minimum distance constants (adjust as needed) pub const PUMPKIN_DENSITY_PERCENT: f32 = 0.5; pub const MIN_PUMPKIN_DISTANCE_SQ: f32 = (PUMPKIN_RADIUS * 2.0 + 50.0) * (PUMPKIN_RADIUS * 2.0 + 50.0); pub const MIN_PUMPKIN_TREE_DISTANCE_SQ: f32 = (PUMPKIN_RADIUS + crate::tree::TREE_RADIUS + 50.0) * (PUMPKIN_RADIUS + crate::tree::TREE_RADIUS + 50.0); pub const MIN_PUMPKIN_STONE_DISTANCE_SQ: f32 = (PUMPKIN_RADIUS + crate::stone::STONE_RADIUS + 50.0) * (PUMPKIN_RADIUS + crate::stone::STONE_RADIUS + 50.0); // Add similar constants for other resources if needed (e.g., MIN_PUMPKIN_CORN_DISTANCE_SQ)
- Define the
- Implement Interaction Reducer (
src/pumpkin.rs):- Create a reducer
interact_with_pumpkin(ctx: &ReducerContext, pumpkin_id: u64).#[spacetimedb::reducer] pub fn interact_with_pumpkin(ctx: &ReducerContext, pumpkin_id: u64) -> Result<(), String> { let sender_id = ctx.sender; let pumpkin_entity = ctx.db.pumpkin().id().find(pumpkin_id) .ok_or_else(|| format!("Pumpkin with ID {} not found.", pumpkin_id))?; validate_player_resource_interaction(ctx, sender_id, pumpkin_entity.pos_x, pumpkin_entity.pos_y)?; if pumpkin_entity.respawn_at.is_some() { return Err("Pumpkin is not ready to be harvested.".to_string()); } collect_resource_and_schedule_respawn( ctx, sender_id, pumpkin_id, // The ID of the pumpkin entity itself PUMPKIN_YIELD_ITEM_NAME.to_string(), // The *name* of the item to give PUMPKIN_YIELD_AMOUNT, PUMPKIN_RESPAWN_TIME_SECS, |db_pumpkin_table, id_to_update, respawn_timestamp| { // Closure to update the pumpkin table if let Some(mut p) = db_pumpkin_table.id().find(id_to_update) { p.respawn_at = Some(respawn_timestamp); db_pumpkin_table.id().update(p); Ok(()) } else { Err(format!("Failed to find pumpkin {} to mark for respawn.", id_to_update)) } }, |pumpkin_table_handle| pumpkin_table_handle.id() // Provide PK index accessor )?; log::info!("Player {} collected pumpkin {}", sender_id, pumpkin_id); Ok(()) }
- Create a reducer
- Register Module (
src/lib.rs):- Add
mod pumpkin;to the module declarations. - Add
use crate::pumpkin::pumpkin as PumpkinTableTrait;for the table trait import.
- Add
- Update Seeding (
src/environment.rs):- Add
use crate::pumpkin;anduse crate::pumpkin::pumpkin as PumpkinTableTrait;. - In
seed_environment:- Get the table accessor:
let pumpkins = ctx.db.pumpkin(); - Initialize a position vector:
let mut spawned_pumpkin_positions: Vec<(f32, f32)> = Vec::new(); - Calculate
target_pumpkin_countusingPUMPKIN_DENSITY_PERCENT. - Add a loop calling
attempt_single_spawn, providing:pumpkinstable accessor.spawned_pumpkin_positions.PUMPKIN_RADIUS.- Pumpkin-specific distance constants (e.g.,
MIN_PUMPKIN_DISTANCE_SQ,MIN_PUMPKIN_TREE_DISTANCE_SQ). - A closure to create a
crate::pumpkin::Pumpkininstance (withid: 0,pos_x,pos_y,chunk_index,respawn_at: None).
- Update
count_all_resourcesto includepumpkins.count() as i32.
- Get the table accessor:
- Add
- Update Respawning (
src/environment.rs):- In
check_resource_respawns, add a call to thecheck_and_respawn_resource!macro:check_and_respawn_resource!( ctx, pumpkin, // Table name (lowercase) crate::pumpkin::Pumpkin, // Struct type "Pumpkin", // Log message name |_p: &crate::pumpkin::Pumpkin| true, // Condition to check if respawn_at is set |p: &mut crate::pumpkin::Pumpkin| { // Closure to reset respawn_at p.respawn_at = None; } );
- In
- Add Consumable Effects (Optional -
src/consumables.rs):- If "Pumpkin" item is directly edible:
- Define constants like
PUMPKIN_HEALTH_GAIN. - Update the
consume_itemreducer'smatchstatement to handle"Pumpkin".
- Define constants like
- If "Pumpkin" item is directly edible:
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 520 lines · 15 tokens per session scan A 1b8a0dfac499
resources is a cursor rule published in the GitHub repository thinktidevibes/2D-Survival-Multiplayer-Game (11 stars, last pushed 1y ago), licensed MIT. It adds 15 tokens to every session and 8,008 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
08-client-server
IF 判断当前环境是否为客户端 → FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT → World.isClient(Yarn 字段;yarn 1.14.4 World.mapping)。不要用 MCP/Forge 的 isRemote.
07-datagen
IF 生成物品/方块模型 JSON → 手动编写 JSON 在 src/main/resources/assets/{modid}/models/.
meta-quest-agentic-tools
Use Meta Quest Agentic Tools for Meta Quest and Horizon OS samples.
narrative-writing
游戏叙事写作助手行为约束(game-narrative-mcp).
meta-quest-agentic-tools
Use Meta Quest Agentic Tools for Meta Quest and Horizon OS samples.
visual-and-observational-rules
Defines the visual aspects of the game and how the player observes the world. This includes map color-coding, screen effects, and the overall simulation style.