Skip to content

1.23版本物品id变更

简介

1.23版本与1.22版本相比,有部分物品的名称发生了变更,例如生鱼从minecraft:fish变为minecraft:cod;牛奶桶从minecraft:bucket,附加值为1,改为minecraft:milk_bucket,附加值为0。

处理方法

在ModSDK的接口与事件中,我们针对上述情况做了以下处理:

  1. 对于接受物品名称与附加值的接口,同时兼容旧版名称与新版名称

    如SetUiItem接口

  2. 在物品信息字典中添加newItemName及newAuxValue字段。

    • 对于返回物品信息字典的接口与事件:

      新字段newItemName及newAuxValue返回新版名称与附加值。

      原字段itemName及auxValue返回旧版名称与附加值。

      例如GetPlayerItem接口,OnCarriedNewItemChangedServerEvent事件

    • 对于接受物品信息字典的接口与事件:

      当字典存在newItemName及newAuxValue时,使用这两个新字段。

      不存在时,使用旧字段itemName及auxValue。

      例如SpawnItemToPlayerCarried接口,EntityDieLoottableServerEvent事件

注意事项

  • 获取配方的接口,返回值没有做兼容,例如GetRecipeResult,GetRecipesByResult,GetRecipesByInput,将返回新版名称与附加值,如果您的组件对此有依赖,则需要对这次的改动自行做兼容处理。

  • 新开发或正在开发的组件,建议统一采用新的newItemName及newAuxValue字段,也不要新旧字段混用。

  • 某些写法可能会失效,例如

    python
    # 获取itemDict,然后在他基础上修改itemName或auxValue后再用来生成
    itemdict = GetPlayerItem()
    itemdict['itemName'] = 'xxx'
    itemdict['auxValue'] = itemdict['auxValue']+1
    SpawnItemToPlayerInv(itemdict)

    因为GetPlayerItem返回的itemDict含有新字段,再传入SpawnItemToPlayerInv时,会读取新字段生成物品,因此对原字段的修改无效。

物品名称变更表

以下为1.23版本变更了名称的物品列表。表格内的名称省略了minecraft命名空间。

旧名称旧附加值新名称
carrotonastickcarrot_on_a_stick
fishcod
cooked_fishcooked_cod
clownfishtropical_fish
muttoncookedcooked_mutton
appleenchantedenchanted_golden_apple
fireballfire_charge
fireworksfirework_rocket
fireworkschargefirework_star
speckled_melonglistering_melon_slice
record_11music_disc_11
record_13music_disc_13
record_blocksmusic_disc_blocks
record_catmusic_disc_cat
record_chirpmusic_disc_chirp
record_farmusic_disc_far
record_mallmusic_disc_mall
record_mellohimusic_disc_mellohi
record_pigstepmusic_disc_pigstep
record_stalmusic_disc_stal
record_stradmusic_disc_strad
record_waitmusic_disc_wait
record_wardmusic_disc_ward
muttonrawmutton
netherstarnether_star
chorus_fruit_poppedpopped_chorus_fruit
melonmelon_slice
reedssugar_cane
horsearmorleatherleather_horse_armor
horsearmorironiron_horse_armor
horsearmorgoldgolden_horse_armor
horsearmordiamonddiamond_horse_armor
turtle_shell_piecescute
totemtotem_of_undying
lodestonecompasslodestone_compass
mapfilled_map
emptymapempty_map
signoak_sign
darkoak_signdark_oak_sign
boat0oak_boat
boat1spruce_boat
boat2birch_boat
boat3jungle_boat
boat4acacia_boat
boat5dark_oak_boat
coal0coal
coal1charcoal
bucket0bucket
bucket1milk_bucket
bucket2cod_bucket
bucket3salmon_bucket
bucket4tropical_fish_bucket
bucket5pufferfish_bucket
bucket8water_bucket
bucket10lava_bucket
dye0ink_sac
dye1red_dye
dye2green_dye
dye3cocoa_beans
dye4lapis_lazuli
dye5purple_dye
dye6cyan_dye
dye7light_gray_dye
dye8gray_dye
dye9pink_dye
dye10lime_dye
dye11yellow_dye
dye12light_blue_dye
dye13magenta_dye
dye14orange_dye
dye15bone_meal
dye16black_dye
dye17brown_dye
dye18blue_dye
dye19white_dye
banner_pattern0creeper_banner_pattern
banner_pattern1skull_banner_pattern
banner_pattern2flower_banner_pattern
banner_pattern3mojang_banner_pattern
banner_pattern4field_masoned_banner_pattern
banner_pattern5bordure_indented_banner_pattern
banner_pattern6piglin_banner_pattern
spawn_egg10chicken_spawn_egg
spawn_egg11cow_spawn_egg
spawn_egg12pig_spawn_egg
spawn_egg13sheep_spawn_egg
spawn_egg14wolf_spawn_egg
spawn_egg15villager_spawn_egg
spawn_egg16mooshroom_spawn_egg
spawn_egg17squid_spawn_egg
spawn_egg18rabbit_spawn_egg
spawn_egg19bat_spawn_egg
spawn_egg22ocelot_spawn_egg
spawn_egg23horse_spawn_egg
spawn_egg24donkey_spawn_egg
spawn_egg25mule_spawn_egg
spawn_egg26skeleton_horse_spawn_egg
spawn_egg27zombie_horse_spawn_egg
spawn_egg28polar_bear_spawn_egg
spawn_egg29llama_spawn_egg
spawn_egg30parrot_spawn_egg
spawn_egg31dolphin_spawn_egg
spawn_egg32zombie_spawn_egg
spawn_egg33creeper_spawn_egg
spawn_egg34skeleton_spawn_egg
spawn_egg35spider_spawn_egg
spawn_egg36zombie_pigman_spawn_egg
spawn_egg37slime_spawn_egg
spawn_egg38enderman_spawn_egg
spawn_egg39silverfish_spawn_egg
spawn_egg40cave_spider_spawn_egg
spawn_egg41ghast_spawn_egg
spawn_egg42magma_cube_spawn_egg
spawn_egg43blaze_spawn_egg
spawn_egg44zombie_villager_spawn_egg
spawn_egg45witch_spawn_egg
spawn_egg46stray_spawn_egg
spawn_egg47husk_spawn_egg
spawn_egg48wither_skeleton_spawn_egg
spawn_egg49guardian_spawn_egg
spawn_egg50elder_guardian_spawn_egg
spawn_egg51npc_spawn_egg
spawn_egg54shulker_spawn_egg
spawn_egg55endermite_spawn_egg
spawn_egg56agent_spawn_egg
spawn_egg57vindicator_spawn_egg
spawn_egg58phantom_spawn_egg
spawn_egg59ravager_spawn_egg
spawn_egg74turtle_spawn_egg
spawn_egg75cat_spawn_egg
spawn_egg104evoker_spawn_egg
spawn_egg105vex_spawn_egg
spawn_egg108pufferfish_spawn_egg
spawn_egg109salmon_spawn_egg
spawn_egg110drowned_spawn_egg
spawn_egg111tropical_fish_spawn_egg
spawn_egg112cod_spawn_egg
spawn_egg113panda_spawn_egg
spawn_egg114pillager_spawn_egg
spawn_egg115villager_spawn_egg
spawn_egg116zombie_villager_spawn_egg
spawn_egg118wandering_trader_spawn_egg
spawn_egg121fox_spawn_egg
spawn_egg122bee_spawn_egg
spawn_egg123piglin_spawn_egg
spawn_egg124hoglin_spawn_egg
spawn_egg125strider_spawn_egg
spawn_egg126zoglin_spawn_egg
spawn_egg127piglin_brute_spawn_egg
spawn_egg128goat_spawn_egg
spawn_egg自定义生物生物identifier_spawn_egg