How ctarron/item_destruction_warning works
Project type and purpose
• This is a Minecraft “datapack” — a pure data‑driven mod that plugs into the Minecraft engine.
• Purpose: watch for certain “important” items being destroyed or despawning, and send a chat notification when that happens.
File structure
• Top‐level:
• pack.mcmeta – datapack manifest
• data/ – contains all namespaced data under two namespaces:
◦ ctarron_destruction_warning/ – your custom namespace
· function/ – MCFunction scripts (load, tick, check_for_hoppers, etc.)
· predicate/ – JSON filters for logic decisions
· tags/item/ – lists of items marked “important” or “important_named”
◦ minecraft/ – hooks into vanilla behavior
· tags/function/ – load.json, tick.json to register your functions with the engine
• No “binary” code or external services—everything is JSON and plaintext functions that the engine interprets.
Review README insights
• Confirms the goal (“send a chat message when an important item despawns or is destroyed”).
• Enumerates which items are always “important” vs. only important when named.
Main components
a. Minecraft Engine & Datapack Loader
b. Namespaced datapack (ctarron_destruction_warning)
– Functions (load.mcfunction, tick.mcfunction, check_for_hoppers.mcfunction, etc.)
– Predicates (has_marker_passenger.json, is_important.json, etc.)
– Tags (lists of items under tags/item/*.json)
c. Vanilla integration namespace (minecraft/tags/function)
– load.json (calls ctarron:load)
– tick.json (calls ctarron:tick)
d. Chat Output subsystem (in‐game player chat)
Relationships & interactions
1. On startup, the engine reads pack.mcmeta → registers the datapack
2. Engine reads minecraft/tags/function/load.json → calls ctarron_destruction_warning:function/load.mcfunction
3. Engine’s tick loop invokes ctarron_destruction_warning:function/tick.mcfunction every game tick via minecraft/tags/function/tick.json
4. tick.mcfunction orchestrates:
• calls check_for_hoppers (detects carried items)
• calls has_despawned (compares current items to previous state)
• uses predicates (is_important, is_important_when_named) to filter items
• when a target is found, calls message.mcfunction to send chat
5. Tags JSON provide the item‐lists that predicates query
Architectural patterns & design principles
• Event‑driven: functions triggered on load & on every tick
• Data‑driven: JSON predicates and tags completely drive logic and item definitions
• Namespace isolation: separates your datapack logic (ctarron_destruction_warning) from vanilla (minecraft)
Final checklist
– All components clearly labeled
– Layered layout: Engine → Loader → Namespaced datapack (split into functions + data) → Player chat