File size: 2,037 Bytes
d517dc9 | 1 2 3 4 5 | {"type": "session", "harness": "opencode", "id": "mc-0042", "name": "Loot Tables"}
{"type": "message", "message": {"role": "system", "content": "You are an expert Fabric mod developer. You write idiomatic Minecraft Fabric mods using Java, Fabric API, and Yarn mappings."}}
{"type": "message", "message": {"role": "user", "content": "How do I create loot tables for blocks and entities in Fabric?"}}
{"type": "message", "message": {"role": "assistant", "content": "Place loot table files in data/<modid>/loot_table/ directory.\n\nBlock Loot Table (data/mymod/loot_table/blocks/simple_block.json):\n```json\n{\n \"type\": \"minecraft:block\",\n \"pools\": [{\"rolls\": 1, \"entries\": [{\"type\": \"minecraft:item\", \"name\": \"mymod:simple_block\"}], \n \"conditions\": [{\"condition\": \"minecraft:survives_explosion\"}]}]\n}\n```\n\nBlock with silk touch:\n```json\n{\n \"type\": \"minecraft:block\",\n \"pools\": [\n {\"rolls\": 1, \"entries\": [{\"type\": \"minecraft:item\", \"name\": \"mymod:glass_block\"}],\n \"conditions\": [{\"condition\": \"minecraft:match_tool\", \"predicate\": {\"enchantments\": [{\"enchantment\": \"minecraft:silk_touch\", \"levels\": {\"min\": 1}}]}}]},\n {\"rolls\": 1, \"entries\": [{\"type\": \"minecraft:item\", \"name\": \"mymod:glass_shard\"}],\n \"conditions\": [{\"condition\": \"minecraft:inverted\", \"term\": {\"condition\": \"minecraft:match_tool\", \"predicate\": {\"enchantments\": [{\"enchantment\": \"minecraft:silk_touch\", \"levels\": {\"min\": 1}}]}}}]}]\n}\n```\n\nEntity Loot Table (data/mymod/loot_table/entities/custom_entity.json):\n```json\n{\n \"type\": \"minecraft:entity\",\n \"pools\": [\n {\"rolls\": 1, \"entries\": [{\"type\": \"minecraft:item\", \"name\": \"mymod:entity_drop\"}]},\n {\"rolls\": 1, \"entries\": [{\"type\": \"minecraft:item\", \"name\": \"minecraft:experience_bottle\", \n \"functions\": [{\"function\": \"minecraft:set_count\", \"count\": {\"min\": 5, \"max\": 10, \"type\": \"minecraft:uniform\"}}]}]}]\n}\n```"}}
|