minecraft-bot/mosfet/info/mobs.py

76 lines
1.4 KiB
Python
Raw Normal View History

from mosfet.info import items
2020-12-04 02:49:22 +00:00
import json
2020-12-14 05:40:17 +00:00
with open('minecraft_data/registries.json') as f:
2020-12-04 02:49:22 +00:00
MOBS = json.load(f)['minecraft:entity_type']['entries']
VILLAGER = 93
ARMORER = 1
BUTCHER = 2
CARTOGRAPHER = 3
CLERIC = 4
FARMER = 5
FISHERMAN = 6
FLETCHER = 7
LEATHERWORKER = 8
LIBRARIAN = 9
MASON = 10
NITWIT = 11
SHEPHERD = 12
TOOLSMITH = 13
WEAPONSMITH = 14
TRADES = {
ARMORER: [items.IRON_INGOT_ID],
BUTCHER: [items.BERRIES_ID],
FARMER: [items.PUMPKIN_ID, items.WHEAT_ID, items.POTATO_ID, items.CARROT_ID, items.BEETROOT_ID],
TOOLSMITH: [items.IRON_INGOT_ID],
WEAPONSMITH: [items.IRON_INGOT_ID],
}
2020-12-04 02:49:22 +00:00
EVIL = [
'blaze',
'cave_spider',
'creeper',
'drowned',
'elder_guardian',
'ender_dragon',
'enderman',
'endermite',
'evoker',
'ghast',
'giant',
'guardian',
'hoglin',
'husk',
'illusioner',
'magma_cube',
'phantom',
'piglin',
'piglin_brute',
'pillager',
'ravager',
'shulker',
'silverfish',
'skeleton',
'skeleton_horse',
'slime',
'spider',
'stray',
'vex',
'vindicator',
'witch',
'wither',
'zoglin',
'zombie',
'zombie_villager',
]
EVIL_IDS = set()
for mob_name in EVIL:
EVIL_IDS.add(MOBS['minecraft:'+mob_name]['protocol_id'])
MOB_NAMES = {}
for mob_name, mob in MOBS.items():
MOB_NAMES[MOBS[mob_name]['protocol_id']] = mob_name.replace('minecraft:', '')