使用 Zed Editor 开发网易我的世界 Addon 时使用 minecraft-bedrock-json-schemas
壹；前言最近迷上了 Zed Editor，将原本 PyCharm 与 VSCode 的环境都迁移至 Zed，也将Blockception/minecraft-bedrock-json-schemas的提示迁移至 Zed，同时镜像了Blockception/minecraft-bedrock-json-schemas仓库于国内站点，对部分功能进行汉化与添加网易特殊配置的提示。原仓库地址：https://github.com/Blockception/Minecraft-bedrock-json-schemas镜像仓库地址：https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas(这是一个由社区维护的汉化镜像，并非官方版本。原始项目由 Blockception 创建并维护)贰；前置工具Zed Editor叁；效果预览肆；配置修改{ "file_types": { "JSONC": ["*.json"] }, "languages": { "JSONC": { "language_servers": ["json-language-server"] } }, "lsp": { "json-language-server": { "settings": { "json": { "schemas": [ { "fileMatch": ["skin_pack/skins.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/skinpacks/skins.json" }, { "fileMatch": ["language_names.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/language/language_names.json" }, { "fileMatch": ["languages.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/language/languages.json" }, { "fileMatch": ["manifest.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/general/manifest.json" }, { "fileMatch": [ "world_behavior_packs.{json,jsonc,json5}", "world_resource_packs.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/general/world_x_packs.json" }, { "fileMatch": [ "resource_packs/*/animation_controllers/*.{json,jsonc,json5}", "*resource*pack*/animation_controllers/*.{json,jsonc,json5}", "*Resource*Pack*/animation_controllers/*.{json,jsonc,json5}", "*RP*/animation_controllers/*.{json,jsonc,json5}", "*rp*/animation_controllers/*.{json,jsonc,json5}", "resource_packs/*/animation_controllers/**/*.{json,jsonc,json5}", "*resource*pack*/animation_controllers/**/*.{json,jsonc,json5}", "*Resource*Pack*/animation_controllers/**/*.{json,jsonc,json5}", "*RP*/animation_controllers/**/*.{json,jsonc,json5}", "*rp*/animation_controllers/**/*.{json,jsonc,json5}", "*.{animation_controller.rp,rpac,ac.rp,rp_ac}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/animation_controllers/animation_controller.json" }, { "fileMatch": [ "resource_packs/*/animations/*.{json,jsonc,json5}", "*resource*pack*/animations/*.{json,jsonc,json5}", "*Resource*Pack*/animations/*.{json,jsonc,json5}", "*RP*/animations/*.{json,jsonc,json5}", "*rp*/animations/*.{json,jsonc,json5}", "resource_packs/*/animations/**/*.{json,jsonc,json5}", "*resource*pack*/animations/**/*.{json,jsonc,json5}", "*Resource*Pack*/animations/**/*.{json,jsonc,json5}", "*RP*/animations/**/*.{json,jsonc,json5}", "*rp*/animations/**/*.{json,jsonc,json5}", "*.{animation.rp,anim.rp,a.rp,rpa}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/animations/actor_animation.json" }, { "fileMatch": [ "resource_packs/*/block_culling/*.{json,jsonc,json5}", "*resource*pack*/block_culling/*.{json,jsonc,json5}", "*Resource*Pack*/block_culling/*.{json,jsonc,json5}", "*RP*/block_culling/*.{json,jsonc,json5}", "*rp*/block_culling/*.{json,jsonc,json5}", "resource_packs/*/block_culling/**/*.{json,jsonc,json5}", "*resource*pack*/block_culling/**/*.{json,jsonc,json5}", "*Resource*Pack*/block_culling/**/*.{json,jsonc,json5}", "*RP*/block_culling/**/*.{json,jsonc,json5}", "*rp*/block_culling/**/*.{json,jsonc,json5}", "*.{cull}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/block_culling/block_culling.json" }, { "fileMatch": [ "resource_packs/*/attachables/*.{json,jsonc,json5}", "*resource*pack*/attachables/*.{json,jsonc,json5}", "*Resource*Pack*/attachables/*.{json,jsonc,json5}", "*RP*/attachables/*.{json,jsonc,json5}", "*rp*/attachables/*.{json,jsonc,json5}", "resource_packs/*/attachables/**/*.{json,jsonc,json5}", "*resource*pack*/attachables/**/*.{json,jsonc,json5}", "*Resource*Pack*/attachables/**/*.{json,jsonc,json5}", "*RP*/attachables/**/*.{json,jsonc,json5}", "*rp*/attachables/**/*.{json,jsonc,json5}", "*.{attachable,attach,at}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/attachables/attachables.json" }, { "fileMatch": [ "resource_packs/*/biomes/*.{json,jsonc,json5}", "*resource*pack*/biomes/*.{json,jsonc,json5}", "*Resource*Pack*/biomes/*.{json,jsonc,json5}", "*RP*/biomes/*.{json,jsonc,json5}", "*rp*/biomes/*.{json,jsonc,json5}", "resource_packs/*/biomes/**/*.{json,jsonc,json5}", "*resource*pack*/biomes/**/*.{json,jsonc,json5}", "*Resource*Pack*/biomes/**/*.{json,jsonc,json5}", "*RP*/biomes/**/*.{json,jsonc,json5}", "*rp*/biomes/**/*.{json,jsonc,json5}", "*.{client_biome}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/biomes/biomes.json" }, { "fileMatch": ["biomes_client.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/biomes_client.json" }, { "fileMatch": ["blocks.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/blocks.json" }, { "fileMatch": [ "resource_packs/*/entity/*.{json,jsonc,json5}", "*resource*pack*/entity/*.{json,jsonc,json5}", "*Resource*Pack*/entity/*.{json,jsonc,json5}", "*RP*/entity/*.{json,jsonc,json5}", "*rp*/entity/*.{json,jsonc,json5}", "resource_packs/*/entity/**/*.{json,jsonc,json5}", "*resource*pack*/entity/**/*.{json,jsonc,json5}", "*Resource*Pack*/entity/**/*.{json,jsonc,json5}", "*RP*/entity/**/*.{json,jsonc,json5}", "*rp*/entity/**/*.{json,jsonc,json5}", "*.{entity.rp,e.rp,ce,rpe,actor,entity}.{json,jsonc,json5}", "!models/entity/**/*.{json,jsonc,json5}", "!models/entity/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/entity/entity.json" }, { "fileMatch": [ "resource_packs/*/fogs/*.{json,jsonc,json5}", "*resource*pack*/fogs/*.{json,jsonc,json5}", "*Resource*Pack*/fogs/*.{json,jsonc,json5}", "*RP*/fogs/*.{json,jsonc,json5}", "*rp*/fogs/*.{json,jsonc,json5}", "resource_packs/*/fogs/**/*.{json,jsonc,json5}", "*resource*pack*/fogs/**/*.{json,jsonc,json5}", "*Resource*Pack*/fogs/**/*.{json,jsonc,json5}", "*RP*/fogs/**/*.{json,jsonc,json5}", "*rp*/fogs/**/*.{json,jsonc,json5}", "*.fog.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/fog/fog.json" }, { "fileMatch": [ "flipbook_textures.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/textures/flipbook_textures.json" }, { "fileMatch": ["item_texture.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/textures/item_texture.json" }, { "fileMatch": ["textures_list.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/textures/textures_list.json" }, { "fileMatch": ["*.texture_set.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/textures/texture_set.json" }, { "fileMatch": [ "resource_packs/*/items/*.{json,jsonc,json5}", "*resource*pack*/items/*.{json,jsonc,json5}", "*Resource*Pack*/items/*.{json,jsonc,json5}", "*RP*/items/*.{json,jsonc,json5}", "*rp*/items/*.{json,jsonc,json5}", "resource_packs/*/items/**/*.{json,jsonc,json5}", "*resource*pack*/items/**/*.{json,jsonc,json5}", "*Resource*Pack*/items/**/*.{json,jsonc,json5}", "*RP*/items/**/*.{json,jsonc,json5}", "*rp*/items/**/*.{json,jsonc,json5}", "*.{item.rp,i.rp,rpi,rp_item}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/items/items.json" }, { "fileMatch": [ "resource_packs/*/models/*.{json,jsonc,json5}", "*resource*pack*/models/*.{json,jsonc,json5}", "*Resource*Pack*/models/*.{json,jsonc,json5}", "*RP*/models/*.{json,jsonc,json5}", "*rp*/models/*.{json,jsonc,json5}", "resource_packs/*/models/**/*.{json,jsonc,json5}", "*resource*pack*/models/**/*.{json,jsonc,json5}", "*Resource*Pack*/models/**/*.{json,jsonc,json5}", "*RP*/models/**/*.{json,jsonc,json5}", "*rp*/models/**/*.{json,jsonc,json5}", "*.{geo,geometry,model,g}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/models/entity/model_entity.json" }, { "fileMatch": ["materials/*.material"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/materials/materials.json" }, { "fileMatch": ["music_definitions.json"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/sounds/music_definitions.json" }, { "fileMatch": [ "resource_packs/*/particles/*.{json,jsonc,json5}", "*resource*pack*/particles/*.{json,jsonc,json5}", "*Resource*Pack*/particles/*.{json,jsonc,json5}", "*RP*/particles/*.{json,jsonc,json5}", "*rp*/particles/*.{json,jsonc,json5}", "resource_packs/*/particles/**/*.{json,jsonc,json5}", "*resource*pack*/particles/**/*.{json,jsonc,json5}", "*Resource*Pack*/particles/**/*.{json,jsonc,json5}", "*RP*/particles/**/*.{json,jsonc,json5}", "*rp*/particles/**/*.{json,jsonc,json5}", "*.{particle,p}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/particles/particles.json" }, { "fileMatch": [ "resource_packs/*/render_controllers/*.{json,jsonc,json5}", "*resource*pack*/render_controllers/*.{json,jsonc,json5}", "*Resource*Pack*/render_controllers/*.{json,jsonc,json5}", "*RP*/render_controllers/*.{json,jsonc,json5}", "*rp*/render_controllers/*.{json,jsonc,json5}", "resource_packs/*/render_controllers/**/*.{json,jsonc,json5}", "*resource*pack*/render_controllers/**/*.{json,jsonc,json5}", "*Resource*Pack*/render_controllers/**/*.{json,jsonc,json5}", "*RP*/render_controllers/**/*.{json,jsonc,json5}", "*rp*/render_controllers/**/*.{json,jsonc,json5}", "*.{render,render_controller,rc}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/render_controllers/render_controllers.json" }, { "fileMatch": [ "sound_definitions.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/sounds/sound_definitions.json" }, { "fileMatch": ["sounds.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/sounds.json" }, { "fileMatch": ["terrain_texture.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/textures/terrain_texture.json" }, { "fileMatch": ["ui/_ui_defs.{json,jsonc,json5}"], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/ui/_ui_defs.json" }, { "fileMatch": [ "ui/_global_variables.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/ui/_global_variables.json" }, { "fileMatch": [ "resource_packs/*/ui/*.{json,jsonc,json5}", "*resource*pack*/ui/*.{json,jsonc,json5}", "*Resource*Pack*/ui/*.{json,jsonc,json5}", "*RP*/ui/*.{json,jsonc,json5}", "*rp*/items/*.{json,jsonc,json5}", "resource_packs/*/ui/**/*.{json,jsonc,json5}", "*resource*pack*/ui/**/*.{json,jsonc,json5}", "*Resource*Pack*/ui/**/*.{json,jsonc,json5}", "*RP*/ui/**/*.{json,jsonc,json5}", "*rp*/ui/**/*.{json,jsonc,json5}", "!ui/_ui_defs.{json,jsonc,json5}", "!ui/_global_variables.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/ui/ui.json" }, { "fileMatch": [ "behavior_packs/*/animation_controllers/*.{json,jsonc,json5}", "*behavior*pack*/animation_controllers/*.{json,jsonc,json5}", "*Behavior*Pack*/animation_controllers/*.{json,jsonc,json5}", "*BP*/animation_controllers/*.{json,jsonc,json5}", "*bp*/animation_controllers/*.{json,jsonc,json5}", "behavior_packs/*/animation_controllers/**/*.{json,jsonc,json5}", "*behavior*pack*/animation_controllers/**/*.{json,jsonc,json5}", "*Behavior*Pack*/animation_controllers/**/*.{json,jsonc,json5}", "*BP*/animation_controllers/**/*.{json,jsonc,json5}", "*bp*/animation_controllers/**/*.{json,jsonc,json5}", "*.{animation_controller.bp,bpac,ac.bp,bp_ac}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/animation_controllers/animation_controller.json" }, { "fileMatch": [ "behavior_packs/*/animations/*.{json,jsonc,json5}", "*behavior*pack*/animations/*.{json,jsonc,json5}", "*Behavior*Pack*/animations/*.{json,jsonc,json5}", "*BP*/animations/*.{json,jsonc,json5}", "*bp*/animations/*.{json,jsonc,json5}", "behavior_packs/*/animations/**/*.{json,jsonc,json5}", "*behavior*pack*/animations/**/*.{json,jsonc,json5}", "*Behavior*Pack*/animations/**/*.{json,jsonc,json5}", "*BP*/animations/**/*.{json,jsonc,json5}", "*bp*/animations/**/*.{json,jsonc,json5}", "*.{animation.bp,anim.bp,a.bp,bpa,bp_anim}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/animations/animations.json" }, { "fileMatch": [ "behavior_packs/*/biomes/*.{json,jsonc,json5}", "*behavior*pack*/biomes/*.{json,jsonc,json5}", "*Behavior*Pack*/biomes/*.{json,jsonc,json5}", "*BP*/biomes/*.{json,jsonc,json5}", "*bp*/biomes/*.{json,jsonc,json5}", "behavior_packs/*/biomes/**/*.{json,jsonc,json5}", "*behavior*pack*/biomes/**/*.{json,jsonc,json5}", "*Behavior*Pack*/biomes/**/*.{json,jsonc,json5}", "*BP*/biomes/**/*.{json,jsonc,json5}", "*bp*/biomes/**/*.{json,jsonc,json5}", "*.biome.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/biomes/biomes.json" }, { "fileMatch": [ "behavior_packs/*/blocks/*.{json,jsonc,json5}", "*behavior*pack*/blocks/*.{json,jsonc,json5}", "*Behavior*Pack*/blocks/*.{json,jsonc,json5}", "*BP*/blocks/*.{json,jsonc,json5}", "*bp*/blocks/*.{json,jsonc,json5}", "behavior_packs/*/blocks/**/*.{json,jsonc,json5}", "*behavior*pack*/blocks/**/*.{json,jsonc,json5}", "*Behavior*Pack*/blocks/**/*.{json,jsonc,json5}", "*BP*/blocks/**/*.{json,jsonc,json5}", "*bp*/blocks/**/*.{json,jsonc,json5}", "*.{block,b}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/blocks/blocks.json" }, { "fileMatch": [ "cameras/presets/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/cameras/presets/cameras.json" }, { "fileMatch": [ "behavior_packs/*/dialogue/*.{json,jsonc,json5}", "*behavior*pack*/dialogue/*.{json,jsonc,json5}", "*Behavior*Pack*/dialogue/*.{json,jsonc,json5}", "*BP*/dialogue/*.{json,jsonc,json5}", "*bp*/dialogue/*.{json,jsonc,json5}", "behavior_packs/*/dialogue/**/*.{json,jsonc,json5}", "*behavior*pack*/dialogue/**/*.{json,jsonc,json5}", "*Behavior*Pack*/dialogue/**/*.{json,jsonc,json5}", "*BP*/dialogue/**/*.{json,jsonc,json5}", "*bp*/dialogue/**/*.{json,jsonc,json5}", "*.{diag,dialogue,dialog,d}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/dialogue/dialogue.json" }, { "fileMatch": [ "behavior_packs/*/entities/*.{json,jsonc,json5}", "*behavior*pack*/entities/*.{json,jsonc,json5}", "*Behavior*Pack*/entities/*.{json,jsonc,json5}", "*BP*/entities/*.{json,jsonc,json5}", "*bp*/entities/*.{json,jsonc,json5}", "behavior_packs/*/entities/**/*.{json,jsonc,json5}", "*behavior*pack*/entities/**/*.{json,jsonc,json5}", "*Behavior*Pack*/entities/**/*.{json,jsonc,json5}", "*BP*/entities/**/*.{json,jsonc,json5}", "*bp*/entities/**/*.{json,jsonc,json5}", "*.{entity.bp,e.bp,se,e.bp,bpe,behavior}.{json,jsonc,json5}", "!*loot_tables*" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/entities/entities.json" }, { "fileMatch": [ "behavior_packs/functions/tick.{json,jsonc,json5}", "*behavior*pack*/functions/tick.{json,jsonc,json5}", "*Behavior*Pack*/functions/tick.{json,jsonc,json5}", "*BP*/functions/tick.{json,jsonc,json5}", "*bp*/functions/tick.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/functions/tick.json" }, { "fileMatch": [ "behavior_packs/*/features/*.{json,jsonc,json5}", "*behavior*pack*/features/*.{json,jsonc,json5}", "*Behavior*Pack*/features/*.{json,jsonc,json5}", "*BP*/features/*.{json,jsonc,json5}", "*bp*/features/*.{json,jsonc,json5}", "behavior_packs/*/features/**/*.{json,jsonc,json5}", "*behavior*pack*/features/**/*.{json,jsonc,json5}", "*Behavior*Pack*/features/**/*.{json,jsonc,json5}", "*BP*/features/**/*.{json,jsonc,json5}", "*bp*/features/**/*.{json,jsonc,json5}", "*.{feature,f}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/features/features.json" }, { "fileMatch": [ "behavior_packs/*/feature_rules/*.{json,jsonc,json5}", "*behavior*pack*/feature_rules/*.{json,jsonc,json5}", "*Behavior*Pack*/feature_rules/*.{json,jsonc,json5}", "*BP*/feature_rules/*.{json,jsonc,json5}", "*bp*/feature_rules/*.{json,jsonc,json5}", "behavior_packs/*/feature_rules/**/*.{json,jsonc,json5}", "*behavior*pack*/feature_rules/**/*.{json,jsonc,json5}", "*Behavior*Pack*/feature_rules/**/*.{json,jsonc,json5}", "*BP*/feature_rules/**/*.{json,jsonc,json5}", "*bp*/feature_rules/**/*.{json,jsonc,json5}", "*.{feature_rule,fr}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/feature_rules/feature_rules.json" }, { "fileMatch": [ "behavior_packs/*/items/*.{json,jsonc,json5}", "*behavior*pack*/items/*.{json,jsonc,json5}", "*Behavior*Pack*/items/*.{json,jsonc,json5}", "*BP*/items/*.{json,jsonc,json5}", "*bp*/items/*.{json,jsonc,json5}", "behavior_packs/*/items/**/*.{json,jsonc,json5}", "*behavior*pack*/items/**/*.{json,jsonc,json5}", "*Behavior*Pack*/items/**/*.{json,jsonc,json5}", "*BP*/items/**/*.{json,jsonc,json5}", "*bp*/items/**/*.{json,jsonc,json5}", "*.{item.bp,i.bp,bpi,bp_item}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/items/items.json" }, { "fileMatch": [ "behavior_packs/*/recipes/*.{json,jsonc,json5}", "*behavior*pack*/recipes/*.{json,jsonc,json5}", "*Behavior*Pack*/recipes/*.{json,jsonc,json5}", "*BP*/recipes/*.{json,jsonc,json5}", "*bp*/recipes/*.{json,jsonc,json5}", "behavior_packs/*/recipes/**/*.{json,jsonc,json5}", "*behavior*pack*/recipes/**/*.{json,jsonc,json5}", "*Behavior*Pack*/recipes/**/*.{json,jsonc,json5}", "*BP*/recipes/**/*.{json,jsonc,json5}", "*bp*/recipes/**/*.{json,jsonc,json5}", "*.{recipe,crafting_recipe,cr,r}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/recipes/recipes.json" }, { "fileMatch": [ "behavior_packs/*/loot_tables/*.{json,jsonc,json5}", "*behavior*pack*/loot_tables/*.{json,jsonc,json5}", "*Behavior*Pack*/loot_tables/*.{json,jsonc,json5}", "*BP*/loot_tables/*.{json,jsonc,json5}", "*bp*/loot_tables/*.{json,jsonc,json5}", "behavior_packs/*/loot_tables/**/*.{json,jsonc,json5}", "*behavior*pack*/loot_tables/**/*.{json,jsonc,json5}", "*Behavior*Pack*/loot_tables/**/*.{json,jsonc,json5}", "*BP*/loot_tables/**/*.{json,jsonc,json5}", "*bp*/loot_tables/**/*.{json,jsonc,json5}", "*.{loot,loot_table,lt}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/loot_tables/loot_tables.json" }, { "fileMatch": [ "behavior_packs/*/spawn_rules/*.{json,jsonc,json5}", "*behavior*pack*/spawn_rules/*.{json,jsonc,json5}", "*Behavior*Pack*/spawn_rules/*.{json,jsonc,json5}", "*BP*/spawn_rules/*.{json,jsonc,json5}", "*bp*/spawn_rules/*.{json,jsonc,json5}", "behavior_packs/*/spawn_rules/**/*.{json,jsonc,json5}", "*behavior*pack*/spawn_rules/**/*.{json,jsonc,json5}", "*Behavior*Pack*/spawn_rules/**/*.{json,jsonc,json5}", "*BP*/spawn_rules/**/*.{json,jsonc,json5}", "*bp*/spawn_rules/**/*.{json,jsonc,json5}", "*.{spawn,sr,spawn_rule}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/spawn_rules/spawn_rules.json" }, { "fileMatch": [ "behavior_packs/*/trading/*.{json,jsonc,json5}", "*behavior*pack*/trading/*.{json,jsonc,json5}", "*Behavior*Pack*/trading/*.{json,jsonc,json5}", "*BP*/trading/*.{json,jsonc,json5}", "*bp*/trading/*.{json,jsonc,json5}", "behavior_packs/*/trading/**/*.{json,jsonc,json5}", "*behavior*pack*/trading/**/*.{json,jsonc,json5}", "*Behavior*Pack*/trading/**/*.{json,jsonc,json5}", "*BP*/trading/**/*.{json,jsonc,json5}", "*bp*/trading/**/*.{json,jsonc,json5}", "*.{trade,trade_table.tt}.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/trading/trading.json" }, { "fileMatch": [ "behavior_packs/*/worldgen/jigsaw_structures/*.{json,jsonc,json5}", "*behavior*pack*/worldgen/jigsaw_structures/*.{json,jsonc,json5}", "*Behavior*Pack*/worldgen/jigsaw_structures/*.{json,jsonc,json5}", "*BP*/worldgen/jigsaw_structures/*.{json,jsonc,json5}", "*bp*/worldgen/jigsaw_structures/*.{json,jsonc,json5}", "behavior_packs/*/worldgen/jigsaw_structures/**/*.{json,jsonc,json5}", "*behavior*pack*/worldgen/jigsaw_structures/**/*.{json,jsonc,json5}", "*Behavior*Pack*/worldgen/jigsaw_structures/**/*.{json,jsonc,json5}", "*BP*/worldgen/jigsaw_structures/**/*.{json,jsonc,json5}", "*bp*/worldgen/jigsaw_structures/**/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/worldgen/jigsaw_structures/jigsaw.json" }, { "fileMatch": [ "behavior_packs/*/worldgen/processors/*.{json,jsonc,json5}", "*behavior*pack*/worldgen/processors/*.{json,jsonc,json5}", "*Behavior*Pack*/worldgen/processors/*.{json,jsonc,json5}", "*BP*/worldgen/processors/*.{json,jsonc,json5}", "*bp*/worldgen/processors/*.{json,jsonc,json5}", "behavior_packs/*/worldgen/processors/**/*.{json,jsonc,json5}", "*behavior*pack*/worldgen/processors/**/*.{json,jsonc,json5}", "*Behavior*Pack*/worldgen/processors/**/*.{json,jsonc,json5}", "*BP*/worldgen/processors/**/*.{json,jsonc,json5}", "*bp*/worldgen/processors/**/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/worldgen/processors/processor_list.json" }, { "fileMatch": [ "behavior_packs/*/worldgen/structure_sets/*.{json,jsonc,json5}", "*behavior*pack*/worldgen/structure_sets/*.{json,jsonc,json5}", "*Behavior*Pack*/worldgen/structure_sets/*.{json,jsonc,json5}", "*BP*/worldgen/structure_sets/*.{json,jsonc,json5}", "*bp*/worldgen/structure_sets/*.{json,jsonc,json5}", "behavior_packs/*/worldgen/structure_sets/**/*.{json,jsonc,json5}", "*behavior*pack*/worldgen/structure_sets/**/*.{json,jsonc,json5}", "*Behavior*Pack*/worldgen/structure_sets/**/*.{json,jsonc,json5}", "*BP*/worldgen/structure_sets/**/*.{json,jsonc,json5}", "*bp*/worldgen/structure_sets/**/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/worldgen/structure_sets/structure_set.json" }, { "fileMatch": [ "behavior_packs/*/worldgen/template_pools/*.{json,jsonc,json5}", "*behavior*pack*/worldgen/template_pools/*.{json,jsonc,json5}", "*Behavior*Pack*/worldgen/template_pools/*.{json,jsonc,json5}", "*BP*/worldgen/template_pools/*.{json,jsonc,json5}", "*bp*/worldgen/template_pools/*.{json,jsonc,json5}", "behavior_packs/*/worldgen/template_pools/**/*.{json,jsonc,json5}", "*behavior*pack*/worldgen/template_pools/**/*.{json,jsonc,json5}", "*Behavior*Pack*/worldgen/template_pools/**/*.{json,jsonc,json5}", "*BP*/worldgen/template_pools/**/*.{json,jsonc,json5}", "*bp*/worldgen/template_pools/**/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/worldgen/template_pools/template_pool.json" }, { "fileMatch": [ "resource_packs/*/textures/*/!(*.texture_set).{json,jsonc,json5}", "*resource*pack*/textures/*/!(*.texture_set).{json,jsonc,json5}", "*Resource*Pack*/textures/*/!(*.texture_set).{json,jsonc,json5}", "*RP*/textures/*/!(*.texture_set).{json,jsonc,json5}", "*rp*/textures/*/!(*.texture_set).{json,jsonc,json5}", "resource_packs/*/textures/*/**/!(*.texture_set).{json,jsonc,json5}", "*resource*pack*/textures/*/**/!(*.texture_set).{json,jsonc,json5}", "*Resource*Pack*/textures/*/**/!(*.texture_set).{json,jsonc,json5}", "*RP*/textures/*/**/!(*.texture_set).{json,jsonc,json5}", "*rp*/textures/*/**/!(*.texture_set).{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/textures/ui_texture_definition.json" }, { "fileMatch": [ "behavior_packs/*/item_catalog/*.{json,jsonc,json5}", "*behavior*pack*/item_catalog/*.{json,jsonc,json5}", "*Behavior*Pack*/item_catalog/*.{json,jsonc,json5}", "*BP*/item_catalog/*.{json,jsonc,json5}", "*bp*/item_catalog/*.{json,jsonc,json5}", "behavior_packs/*/item_catalog/**/*.{json,jsonc,json5}", "*behavior*pack*/item_catalog/**/*.{json,jsonc,json5}", "*Behavior*Pack*/item_catalog/**/*.{json,jsonc,json5}", "*BP*/item_catalog/**/*.{json,jsonc,json5}", "*bp*/item_catalog/**/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/behavior/item_catalog/crafting_item_catalog.json" }, { "fileMatch": [ "resource_packs/*/atmospherics/*.{json,jsonc,json5}", "*resource*pack*/atmospherics/*.{json,jsonc,json5}", "*Resource*Pack*/atmospherics/*.{json,jsonc,json5}", "*RP*/atmospherics/*.{json,jsonc,json5}", "*rp*/atmospherics/*.{json,jsonc,json5}", "resource_packs/*/atmospherics/**/*.{json,jsonc,json5}", "*resource*pack*/atmospherics/**/*.{json,jsonc,json5}", "*Resource*Pack*/atmospherics/**/*.{json,jsonc,json5}", "*RP*/atmospherics/**/*.{json,jsonc,json5}", "*rp*/atmospherics/**/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/atmospherics/atmospherics.json" }, { "fileMatch": [ "resource_packs/*/color_grading/*.{json,jsonc,json5}", "*resource*pack*/color_grading/*.{json,jsonc,json5}", "*Resource*Pack*/color_grading/*.{json,jsonc,json5}", "*RP*/color_grading/*.{json,jsonc,json5}", "*rp*/color_grading/*.{json,jsonc,json5}", "resource_packs/*/color_grading/**/*.{json,jsonc,json5}", "*resource*pack*/color_grading/**/*.{json,jsonc,json5}", "*Resource*Pack*/color_grading/**/*.{json,jsonc,json5}", "*RP*/color_grading/**/*.{json,jsonc,json5}", "*rp*/color_grading/**/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/color_grading/color_grading.json" }, { "fileMatch": [ "resource_packs/*/lighting/*.{json,jsonc,json5}", "*resource*pack*/lighting/*.{json,jsonc,json5}", "*Resource*Pack*/lighting/*.{json,jsonc,json5}", "*RP*/lighting/*.{json,jsonc,json5}", "*rp*/lighting/*.{json,jsonc,json5}", "resource_packs/*/lighting/**/*.{json,jsonc,json5}", "*resource*pack*/lighting/**/*.{json,jsonc,json5}", "*Resource*Pack*/lighting/**/*.{json,jsonc,json5}", "*RP*/lighting/**/*.{json,jsonc,json5}", "*rp*/lighting/**/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/lighting/lighting.json" }, { "fileMatch": [ "resource_packs/*/water/*.{json,jsonc,json5}", "*resource*pack*/water/*.{json,jsonc,json5}", "*Resource*Pack*/water/*.{json,jsonc,json5}", "*RP*/water/*.{json,jsonc,json5}", "*rp*/water/*.{json,jsonc,json5}", "resource_packs/*/water/**/*.{json,jsonc,json5}", "*resource*pack*/water/**/*.{json,jsonc,json5}", "*Resource*Pack*/water/**/*.{json,jsonc,json5}", "*RP*/water/**/*.{json,jsonc,json5}", "*rp*/water/**/*.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/water/water.json" }, { "fileMatch": [ "resource_packs/*/pbr/global.{json,jsonc,json5}", "*resource*pack*/pbr/global.{json,jsonc,json5}", "*Resource*Pack*/pbr/global.{json,jsonc,json5}", "*RP*/pbr/global.{json,jsonc,json5}", "*rp*/pbr/global.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/pbr/pbr.json" }, { "fileMatch": [ "resource_packs/*/local_lighting/local_lighting.{json,jsonc,json5}", "*resource*pack*/local_lighting/local_lighting.{json,jsonc,json5}", "*Resource*Pack*/local_lighting/local_lighting.{json,jsonc,json5}", "*RP*/local_lighting/local_lighting.{json,jsonc,json5}", "*rp*/local_lighting/local_lighting.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/local_lighting/local_lighting.json" }, { "fileMatch": [ "resource_packs/*/shadows/global.{json,jsonc,json5}", "*resource*pack*/shadows/global.{json,jsonc,json5}", "*Resource*Pack*/shadows/global.{json,jsonc,json5}", "*RP*/shadows/global.{json,jsonc,json5}", "*rp*/shadows/global.{json,jsonc,json5}" ], "url": "https://code.mc9y.com/blank038/minecraft-bedrock-json-schemas/raw/branch/main/resource/shadows/shadows.json" } ] } } } } }伍；结尾镜像仓库会持续维护，但是由于个人精力有限推进速度可能较为缓慢，如果汉化有问题可以在下面评论，我会及时纠正相应错误。这是一个由社区维护的汉化镜像，并非官方版本。原始项目由 Blockception 创建并维护This is a community-maintained localization mirror, not an official version. The original project was created and is maintained by Blockception
网易我的世界大型结构控制生成群系与生成范围
壹；前言这篇文章不是为纯新手准备的，你至少了解或掌握以下技能才适合查看。Python(BP) 特征与特征生成规则(BP) 结构与大型结构Molang贰；实现原理1. 纯 Python 实现已知网易大型结构可拆分为不同大小的子结构(16,32,64)，并且提供了初始化时的结构生成事件 PlaceNeteaseStructureFeatureEvent，我们可以通过事件的参数来得到当前结构生成区块群系与坐标，也可以通过设定参数 cancel 来取消结构的生成，但是网易的结构生成事件是每个子结构都会触发，所以我们需要一个唯一标识来标记当前大型结构，我这里使用的方式是通过简单的计算取到第一个结构的起始坐标来做为唯一标识，代码如下。# structureManager.py # -*- coding: utf-8 -*- import mod.server.extraServerApi as serverApi from abyssogenesisScripts.modServer.storage import serverStorage comp_factory = serverApi.GetEngineCompFactory() class StructureManager(object): structures = {} @staticmethod def init(): # 延迟导入避免循环依赖 from abyssogenesisScripts.modServer import serverSystem serverStorage.ServerSystemObj.ListenForEvent( serverSystem.engine_namespace, serverSystem.engine_system_name, "PlaceNeteaseStructureFeatureEvent", StructureManager, StructureManager.on_dispose ) @staticmethod def register(structure_id, xc, zc, size, chance, biomes, radius=0): # type: (str, int, int, int, int, list, int) -> None """ 注册大型结构到结构控制器中, 用于控制群系生成 :param structure_id: 结构标识名 :param xc: 区块 x 宽度 :param zc: 区块 z 宽度 :param size: 单区块大小(16,32) :param chance: 刷新概率 :param biomes: 群系列表 :param radius: xz 超过 (0,0) 坐标半径多少才刷新 """ # 计算最大区块数 maxc = xc * zc # 记录结构数据 StructureManager.structures[structure_id] = { 'structure_id': structure_id, 'xc': xc, 'zc': zc, 'size': size, 'chance': chance, 'biomes': biomes, 'radius': radius } # 注册子区块 comp = comp_factory.CreateFeature(serverApi.GetLevelId()) for i in xrange(1, maxc + 1): comp.AddNeteaseFeatureWhiteList('{}_{}'.format(structure_id, i)) @staticmethod def on_dispose(params): """ 当结构开始生成的时候触发, 此处会判断是否为目标结构 """ # 判断结构是否存在于列表 structure_name = params['structureName'].rsplit('_', 1) if structure_name[0] not in StructureManager.structures: return # 获取结构信息 structure_data = StructureManager.structures[structure_name[0]] # 获取当前索引 index = int(structure_name[1]) - 1 # 计算当前原点坐标 current_x = index / 5 current_z = index % 5 origin_x = params['x'] - current_x * 16 origin_z = params['z'] - current_z * 16 structure_key = "{}_{}_{}_{}".format( params['dimensionId'], structure_name[0], origin_x, origin_z ) # 判断当前遗迹在当前存档中是否处理过 extra_data_comp = comp_factory.CreateExtraData(serverApi.GetLevelId()) extra_data = extra_data_comp.GetExtraData('abyss_structure_state') # 如果为空则创建新数据 if extra_data is None: extra_data = {} extra_data_comp.SetExtraData('abyss_structure_state', {}, True) # 判断当前特征是否存在于数据中 if structure_key in extra_data: # 判断群系是否符合条件 params['cancel'] = extra_data[structure_key] return # 计算条件是否符合 if not check_conditions(structure_data, params): # 取消事件并记录原点坐标 params['cancel'] = True extra_data[structure_key] = True extra_data_comp.SetExtraData('abyss_structure_state', extra_data) return # 标记为符合条件 extra_data[structure_key] = False extra_data_comp.SetExtraData('abyss_structure_state', extra_data) def on_tick(self, params): pass def check_conditions(structure_data, params): # type: (dict, dict) -> bool """ 检测结构生成条件是否达标 """ # 判断群系条件是否符合 if params['biomeName'] not in structure_data['biomes']: return False # 判断是否在限制范围内 radius = structure_data['radius'] if radius > 0 and abs(params['x']) < radius and abs(params['z']) < radius: return False return True # serverSystem.py # -*- coding: utf-8 -*- class AbyssogenesisServerSystem(ServerSystem): def __init__(self, namespace, system_name): # 初始化结构管理器 StructureManager.init() # 记录要监听的结构类型 StructureManager.register( structure_id='vsydn:abyss_stone_giant_reforged', xc=5, zc=5, size=16, chance=100, biomes=['jungle', 'bamboo_jungle'], radius=500 )代码的原理就是通过对大型结构首个生成的子结构计算原点(拆分的第一个结构的起始坐标)位置来做为唯一标识，不管条件符合不符合都写入到自定义数据中存储起来，之后相同大型结构的子结构生成时取到相同原点做判断时，只需要检测原点是否被记录了，如果记录了直接返回记录的状态来达到限制刷新的群系、范围等条件。2. 特征规则 Molang 实现通过纯代码实现的特征规则如果被 PlaceNeteaseStructureFeatureEvent 事件 cancel 之后，无法通过 LocateNeteaseFeatureRule 获取到坐标，如果你需要使用 LocateNeteaseFeatureRule 来定位特征规则坐标那么就需要通过 Molang query.is_biome(x, z, args..) 来实现，如下。{ "format_version": "1.14.0", "minecraft:feature_rules": { "conditions": { "minecraft:biome_filter": [ { "all_of": [ { "any_of": [ { "operator": "==", "test": "has_biome_tag", "value": "overworld" } ] } ] } ], "placement_pass": "surface_pass" }, "description": { "identifier": "vsydn:abyss_stone_giant_reforged", "places_feature": "vsydn:abyss_stone_giant_feature" }, "distribution": { "coordinate_eval_order": "xzy", "iterations": "query.is_biome(variable.originx+0,variable.originz+0,1)&&math.mod(variable.originx+0,336)==0&&math.mod(variable.originz+0,336)==0&&math.abs(query.noise(variable.originx+0,variable.originz+0))<1.0?1:0", "scatter_chance": 100, "x": 0, "y": "query.get_height_at(variable.worldx,variable.worldz)-20", "z": 0 } } }其中 distribution.iterations 开头的 query.is_biome(variable.originx+0,variable.originz+0,1) 就是群系判断的语句，假如你是大型结构，我的建议是通过判断第一个特征结构的位置的群系来决定是否生成，如果要更合理可以取中心子结构的位置，下方是两个子结构的坐标计算语句例子。query.is_biome(variable.originx+0,variable.originz+0,1)query.is_biome(variable.originx+0,variable.originz-16,1)叁；结尾实现逻辑很简单也写上了相应注释，这里不做过多赘述，如果你有更好的方式可以在下方评论留言互相探讨。
GLM-4.6/GLM Coding Plan 对接 claude-code/claude-code-router
壹；前言在 AI 技术日益精进的今天，合理利用 AI 辅助编程能够显著提升工作效率与学习效果。本文主要演示如何将智谱 GLM-4.6 对接至 claude-code-router、以及将 GLM Coding Plan 接入 claude-code，以较低成本打造流畅高效的编程体验。贰；正文注意：文中代码或文件出现的 ... 指的是你其他配置，如果你没有其他配置则只写上演示配置即可。准备步骤智谱 AI 开放平台 API Keys（https://bigmodel.cn/usercenter/proj-mgmt/apikeys）已安装 claude-code / claude-code-router如果你还未安装 claude-code 或 claude-code-router，可以通过下面的命令安装。claude-code：npm install -g @anthropic-ai/claude-codeclaude-code-router：npm install -g @musistudio/claude-code-router如果提示 npm 命令不存在的话，请百度搜索一下 npm 是什么与怎么安装 npm 工具。1. GLM Coding Plan 对接 claude-code (推荐)设置系统变量 ANTHROPIC_BASE_URL 值为 https://open.bigmodel.cn/api/anthropic设置系统变量 ANTHROPIC_AUTH_TOKEN 值为你的 API Keys修改 claude-code 的设置如下，文件路径：~/.claude/settings.json，路径中的 ~ 为你的用户目录，例如 Windows：C:\Users\Administrator\.claude\settings.json{ "env": { "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.5-air", "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.6", "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-4.6" } ... }如果需要一直使用中文回答你的问题，请输入 claude 进入 claude-code 后输入 /memory 指令，选择 User memory，并在打开的文件中写入下方提示词后保存文件。- Always reply in Chinese在项目目录下使用 claude 命令即可使用 GLM Coding Plan 的 GLM-4.6 模型了。2. GLM Coding Plan 对接 claude-code-router在 Providers 下增加模型设置，并在 Router 中启用模型，设置完成后在终端执行 ccr restart 重启 claude-code-router 服务{ ... "Providers": [ { "name": "bigmodel", "api_base_url": "https://open.bigmodel.cn/api/coding/paas/v4/chat/completions", "api_key": "YOUR_API_KEYS", "models": [ "glm-4.6", "glm-4.5-air" ] } ], "Router": { "default": "bigmodel,glm-4.6", "background": "bigmodel,glm-4.5-air", "think": "bigmodel,glm-4.6", "longContext": "bigmodel,glm-4.6", "longContextThreshold": 60000, ... } ... }在项目目录下使用 ccr code 命令即可使用 GLM Coding Plan 的 GLM-4.6 模型了。3. GLM-4.6 对接 claude-code-router参照 GLM Coding Plan 对接 claude-code-router 的步骤进行配置{ ... "Providers": [ { "name": "bigmodel", "api_base_url": "https://open.bigmodel.cn/api/paas/v4/chat/completions", "api_key": "YOUR_API_KEYS", "models": [ "glm-4.6" ] } ], "Router": { "default": "bigmodel,glm-4.6", "background": "bigmodel,glm-4.6", "think": "bigmodel,glm-4.6", "longContext": "bigmodel,glm-4.6", "longContextThreshold": 60000, ... } ... }叁；结尾本文仅展示了基本的对接流程。技术终究是为人服务的工具，希望你进入的是高效的"vibe coding"状态，而不是让 AI 代替你思考与创造的过程。
如何制作一个网易我的世界带技能的 BOSS
本文仅简单演示下我个人在网易我的世界基岩版组件开发过程中制作 BOSS 用到的方法。壹；要求技能MolangAnimationController实体行为文件结构实体资源文件结构Python(可选)BP：行为包RP：资源包贰；哪些方式可以实现？CustomGoal + AnimationController(RP) + Molang(动作会有延迟)原理：通过对生物行为文件添加 CustomGoal 来控制技能的释放与暂停，并同时更新 Molang 来使 AnimationController 同步播放动画，但是这种方式动作播放会有延迟。[推荐] AnimationController(BP) + AnimationController(RP) + Property原理：通过行为文件修改 property，并开启 client_sync 来同步 property 给客户端，RP 的动画控制器通过 property 来同步技能动作，该方式延迟较低，如果对行为文件熟练的话，可以通过纯行为文件来实现技能效果。叁；实现过程这里采用推荐的方案二，BP 的动画控制器用来控制技能的动作切换(控制技能时长来同步客户端动作)过程思考在实现之前，我们需要简单梳理下需要用到东西：网易SDK事件(EntityDefinitionsEventServerEvent)、行为文件事件(event)、行为文件属性(property)。在 BP(行为包) 中也可以实现 animation_controllers 和 animations，与 RP(资源包) 的区别是在 BP 中可以让生物执行命令。如果你对基岩版的实体行为文件熟悉，就知道有 properties 可以设置生物属性，例如：不同颜色的羊。同理，我们也可以通过这个属性来设置当前生物释放的技能状态，再通过 aniamtion_controller 来调用行为文件事件取消技能释放的状态，当然，你也可以通过纯 Python 代码来控制技能状态，但这里按下不表。实现流程生物行为文件中定义一个随机释放技能的事件 example:random_skill生物行为文件中创建一个 enum 类型的 property，值为技能编号与无状态(不懂可以看下方实现逻辑)生物行为文件中定义一个无状态的事件 netease:example_skill_none，用来修改生物技能释放状态为无技能生物行为文件中写好对应技能的 event 来修改 property通过 timer 定时调用 example:random_skill 事件example:random_skill 中通过 randomize 来实现随机技能再调用具体的技能事件通过事件修改技能状态的 property 为对应技能的值Python 代码中监听 EntityDefinitionsEventServerEvent 来同时实现技能逻辑(例如：爆炸、范围伤害、技能音效等)在 aniamtion_controller 中对应的动画控制器下调用 netease:example_skill_none 来取消技能状态实现逻辑behavior_packs/entities/example_test_mob.json{ "format_version": "1.16.0", "minecraft:entity": { "component_groups": { }, "components": { ..., // 创建一个定时器来定时触发随机技能的事件，这里间隔是 8-9 秒 "minecraft:timer": { "looping": true, "randomInterval": true, "time": [ 8, 9 ], "time_down_event": { "event": "netease:random_example_skill", "target": "self" } } }, "description": { "identifier": "example:test_mob", "is_experimental": false, "is_spawnable": true, "is_summonable": true, // 创建一个 property 来调整生物当前的技能状态，并通过 client_sync 同步给客户端。 "properties": { "example:skill_state": { "type": "enum", "values": [ "none", "skill1" ], "default": "none", "client_sync": true } }, // 定义动画控制器与动画 "animations": { "base": "controller.animation.example_test_mob.beh_base", "abyss:stone_skill1": "animation.example_test_mob.beh_skill1" }, // 设置初始动画与动画控制器 "scripts": { "animate": [ "base" ] } }, "events": { // 随机技能事件的事件 "netease:random_example_skill": { "randomize": [ { "weight": 1, "filters": { "test": "has_target" }, "trigger": { "event": "netease:example_skill_1_start", "target": "self" } } ] }, // 修改技能 property 为无技能 "netease:example_skill_none": { "set_property": { "example:skill_state": "none" } }, "netease:example_skill_1_start": { "set_property": { "example:skill_state": "skill1" } } } } }behavior_packs/animation_controllers/example.animation_controller.json{ "format_version": "1.10.0", "animation_controllers": { "controller.animation.example_test_mob.beh_base": { "initial_state": "default", "states": { "default": { "transitions": [ { "beh_skill1_pre": "query.property('example:skill_state') == 'skill1'" } ] }, "beh_skill1_pre": { "animations": [ "example:skill1" ], "transitions": [ { "default": "query.anim_time > 3.5" } ], // 动作播放结束(即技能释放结束)后，调用 netease:example_skill_none 来设置状态为无技能 // 作用是避免技能动作重复触发 "on_exit": [ "@s netease:example_skill_none" ] } } } } }behavior_packs/animations/example_test_mob.animation.json{ "format_version": "1.8.0", "animations": { "animation.example_test_mob.beh_skill1": { "animation_length": 3.5 } } }exampleScripts/modServer/serverSystem.py # 监听 EntityDefinitionsEventServerEvent 的逻辑自行实现 def on_definitions_event(self, params): """ 释放技能 2.5 秒后创建一个爆炸 下方的 entityUtil 是我自己封装的类，你可以将这里修改为你自己的逻辑 """ if not params['eventName'].startswith("netease:example_skill_1_start"): return entity_id = params['entityId'] def _internal_skill1(): # 获取生物面前方块 pos = entityUtil.get_sight_pos(entity_id, 1.5) src_pos = serverApi.GetEngineCompFactory().CreatePos(entity_id).GetPos() # 维度 dimension_id = serverApi.GetEngineCompFactory().CreateDimension(entity_id) # 创建爆炸 entityUtil.create_explosion(entity_id, pos, 3) # 执行延迟逻辑 comp = serverApi.GetEngineCompFactory().CreateGame(serverApi.GetLevelId()) comp.AddTimer(2.5, _internal_skill1)客户端动作也同步的话，只需要在动画控制器中加上 q.property('example:skill_state') == 'skill1' 即可。肆；结尾实现的方式有很多，这里只演示了我觉得最方便的一种方式，如果你技术力可以的话，也可以封装自己的 Entity 类，再通过 CustomGoal 或监听 tick 事件来调用自己的代码逻辑释放技能与冷却控制，使用 TriggerCustomEvent 来触发生物行为事件，该方法自定义性与复用性更高，如果你有其他更好的方法，可以在评论区一起探讨。
修改原生 UI 时审核错误代码18网易官方的 DEMO 中使用的是from client.ui.viewBinder import ViewBinder from client.ui.viewRequest import ViewRequest修改为import mod.client.extraClientApi as clientApi ViewBinder = clientApi.GetViewBinderCls() ViewRequest = clientApi.GetViewViewRequestCls()
我的世界基岩版实体死亡动画无法正常播放
动画修改对死亡动画的根节点增加一个关键帧，如果你的动作已经做在根节点上，请新建一个根节点，如下方的 root 就是根节点。插入关键帧复制下方公式填入关键帧的 Z 轴旋转中Math.min(Math.sqrt(Math.max(0, q.anim_time * 20 - 0.5) / 20 * 1.6), 1) * -90动画控制器修改{ "format_version": "1.10.0", "animation_controllers": { "controller.animation.example.death": { "initial_state": "default", "states": { "default": { "transitions": [ { "override_death": "!q.is_alive" } ] }, "override_death": { "animations": [ "deathing" ], "transitions": [ { "default": "q.is_alive" } ], "blend_transition": 0.5 } } } } }参考资料https://wiki.bedrock.dev/visuals/death-animations
壹；今年做了什么与 KOI-工作室 推进《灾厄之门》网络服。 B站视频列表开发了 Minecraft 模组 Lantern，中文名：灯笼引擎，寓意能为一些开发者指引方向。推进了网易我的世界 PE 组件工作室 AiYo-Studio，在年尾时发布了库存组件，目前数据超越预期。使用 Rust 开发了一个基于网易我的世界 Addon 的 cli 工具 emod-cli，用于打包与创建预设组件等。 emod-cli 贰；今年学了什么今年除了深入学习感兴趣的几门编程语言与一些底层原理外，没有新学习其他编程语言。其他：入门魔方叁；去年的感悟未来还没发生的事情，不要将臆想的结果强加在当下的状态。肆；今年的目标当好、做好一名合格的团队领导者三阶魔方能 sub30伍；结尾简短的文章正如简短的一年，共勉。
仅适用于产品没有开源的情况下作者允许反编译修改时使用。 壹; 配置文件tasks.register('patchJar') { finalizedBy('mergePatch') doLast { def originFile = file('origin/原文件.jar') def tempDir = file("${buildDir}/tempJar") copy { from zipTree(originFile) into tempDir } copy { from 'build/classes/java/main', 'build/resources/main' into tempDir include '**/*.class', '**/*.yml' } } } tasks.register('mergePatch', Jar) { from file("${buildDir}/tempJar") archiveFileName = "${archivesBaseName}-${version}.jar" destinationDirectory = file("${buildDir}/libs") doLast { file("${buildDir}/tempJar").deleteDir() } } tasks.build.dependsOn(tasks.patchJar)
2024-05-22 补充 请求标头需要增加 Referer 指向 https://space.bilibili.com为减少风控提高稳定性，可在设备登录自己账号后复制 dm_img_list, dm_img_str, dm_cover_img_str, dm_img_inter 四个参数覆盖 getDm() 方法返回值。 壹；简介基于 Kotlin 开发封装的 Bilibili 接口客户端, 支持 WebAPI 鉴权。贰；相关代码封装类，支持异步调用，同步执行可直接实例化 HttpBilibiliClientclass HttpBilibiliClient(private val apiUrl: String, private val parameters: String = "") { private var wbi: Boolean = false private val cookies: MutableList<String> = mutableListOf() private val headers: MutableMap<String, List<String>> = mutableMapOf() fun request(): JsonObject { var appendParameters = parameters // 当启用 WBI 签名 if (wbi) { val rawWBIKey: String = "替换成 img_key" + "替换成 sub_key" val mixinKeyEncTab = intArrayOf( 46, 47, 18, 2, 53, 8, 23, 32, 15, 50, 10, 31, 58, 3, 45, 35, 27, 43, 5, 49, 33, 9, 42, 19, 29, 28, 14, 39, 12, 38, 41, 13, 37, 48, 7, 16, 24, 55, 40, 61, 26, 17, 0, 1, 60, 51, 30, 4, 22, 25, 54, 21, 56, 59, 6, 63, 57, 62, 11, 36, 20, 34, 44, 52 ) val key = StringBuilder() for (i in 0..31) { key.append(rawWBIKey[mixinKeyEncTab[i]]) } val mixinKey = key.toString() val wts = System.currentTimeMillis() / 1000 val tempParamenters = "${this.getUrlParameters("$appendParameters&wts=$wts")}$mixinKey" appendParameters = "$appendParameters&w_rid=${DigestUtil.calculateMD5(tempParamenters)}&wts=$wts" } val client = URL("$apiUrl${if (appendParameters.isEmpty()) "" else "?$appendParameters"}") with(client.openConnection() as HttpURLConnection) { val response = StringBuilder() setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.76") setRequestProperty("Accept", "*/*") setRequestProperty("Connection", "keep-alive") if (cookies.isNotEmpty()) { val strJoiner = StringJoiner("; ") cookies.forEach { strJoiner.add(it) } setRequestProperty("Cookie", strJoiner.toString()) } requestMethod = "GET" inputStream.bufferedReader().use { it.lines().forEach { line -> response.append(line) } it.close() headers.putAll(headerFields) return JsonUtil.strToObject(response.toString()) } } } fun setCookie(key: String, value: String): HttpBilibiliClient { this.cookies.add("$key=$value") return this } fun enableWBI(wbi: Boolean = false): HttpBilibiliClient { this.wbi = wbi return this } fun getHeaders(): Map<String, List<String>> { return headers } private fun getUrlParameters(query: String): String { if (query.isEmpty()) { return query } val params = mutableMapOf<String, String>() query.split("&").forEach { param -> val (key, value) = param.split("=") params[key] = value } val sortedParams = params.toSortedMap() return sortedParams.entries.joinToString("&") { (key, value) -> "$key=${URLEncoder.encode(value, "utf8")}" } } } object BilibiliClient { fun openClient(apiUrl: String, parameters: String = "", wbi: Boolean = false, consumer: Consumer<JsonObject>) { CompletableFuture.supplyAsync { HttpBilibiliClient(apiUrl, parameters).enableWBI(wbi).request() }.thenApply { it }.thenAccept { o -> consumer.accept(o) } } fun getDm(): String { val dmRand = "ABCDEFGHIJK".toCharArray() val dmImgList = "[]" val dmImgStr = randomSample(dmRand, 2).joinToString("") val dmCoverImgStr = randomSample(dmRand, 2).joinToString("") val dmImgInter = "{\"ds\":[],\"wh\":[0,0,0],\"of\":[0,0,0]}" val entries = listOf( "dm_img_list" to dmImgList, "dm_img_str" to dmImgStr, "dm_cover_img_str" to dmCoverImgStr, "dm_img_inter" to dmImgInter ) return entries.joinToString("&") { "${it.first}=${it.second}" } } } object DigestUtil { fun calculateMD5(input: String): String { val md = MessageDigest.getInstance("MD5") md.update(input.toByteArray()) val bytes = md.digest() val hexString = StringBuilder() bytes.forEach { val hex = Integer.toHexString(0xFF and it.toInt()) hexString.append(if (hex.length == 1) "0$hex" else hex) } return hexString.toString() } } object JsonUtil { private val gson: Gson = GsonBuilder().create() fun strToObject(string: String): JsonObject { return gson.fromJson(string, JsonObject::class.java) } }调用例子其他接口请自行查找实现，这里只用两个接口做示例。// 获取指定用户视频列表 BilibiliClient.openClient( "https://api.bilibili.com/x/space/wbi/arc/search", "mid=232720681&ps=30&${BilibiliClient.getDm()}", true ) { println(it) // 请求成功后返回的数据 } // 获取最新 img_url, sub_url BilibiliClient.openClient("https://api.bilibili.com/x/web-interface/nav") { println(it) }叁；结尾以上就是本次分享的全部内容，感谢大家的阅读。
个人的一些日常学习方法及管理软件
壹; 前言这篇文章仅分享一些我个人日常学习方法及管理软件，文中提到的软件均为长期使用过的。为什么要分那么多软件？因为在使用软件的时候可以专注于一个类型的事情上，比如：只专注于学习、只专注于任务管理。贰; 日记个人比较推荐使用记事本与笔手写日记，而非在软件上记录，用笔撰写日记与键盘敲打体验是不一样的，虽然键盘能带来更高的效率，但在过程中你的思绪不会像手写一样沉浸与深入，也没有过多影响思考的因素。当然，如果你非要使用软件的话，我会向你推荐 思源笔记 与 memos叁; 滴答清单滴答清单是我现在最离不开的软件了，滴答清单我已使用了快三年时间，我会用它来管理我的事务及项目，在滴答清单更新看板模式之前，我尝试过不少项目管理软件，如：Trello、MicrosoftTodo、Asana、ClickUp 等，其中 Trello 体验较为不错，但免费版只能创建十个看板，而且在一些时候延迟较高。为什么选择滴答清单来管理事务及项目？跨平台支持(Windows、Linux、MacOS、Android、iOS、网页版、浏览器扩展等)、看板模式、时间线模式、番茄钟、四象限、支持分组、任务日期提醒、自定义过滤器、共享协作等。滴答清单我只用于分配今天、未来什么时候要做什么事、项目管理，或有什么新的项目灵感会记录在收集箱中，等我思考确定可行性之后就会分配至任务组并确定任务日期与优先级，在项目管理过程中，我会使用看板模式来分组并分配事务类型，如下图。肆; 思源笔记思源笔记也是我现在离不开的软件之一，我会用他来记录我的年度总结、个人计划、年度计划、季度计划与更详细作品策划和灵感。伍; Cubox这款软件是偶然发现的，整个界面非常简洁美观，非常适合处理碎片化知识及待阅读文章，跨平台支持并且有浏览器扩展，可以在查阅网站或选择需要的内容拖动收藏，我会每天收集一些文章放在 Cubox，当我忙完工作上的事之后，就可以在 Cubox 内直接开始阅读。陆; 结尾这是个快餐化的时代，愿各位在这个充满碎片化信息的汪洋大海中能独立思考，不被沈覆，共勉。