注册信息API

注册表模块(Reg)

ID是游戏运行中动态生成的正整数数值。ID在游戏过程中不会变化,但是在每次启动游戏时ID会发生变化。因此需要注意:任何情况下都不允许将ID存储到文件或存档内!!

若需要存储ID,请使用GetXXXName(int id)来获取并存储其ID的字符串名称。若需要读取ID,请使用GetXXXID(string name)来获取其动态生成的ID。

API

返回值

描述

Reg.ItemID(string name)

int

根据物品名返回注册的动态ID。

Reg.BlockID(string name)

int

根据方块名返回注册的动态ID。

Reg.BlockGroupID(string name)

int

根据方块组名返回注册的动态ID。

Reg.BlockSubGroupID(string name)

int

根据方块子组名返回注册的动态ID。

Reg.BlockEntityID(string name)

int

根据方块实体名返回注册的动态ID。

Reg.EffectID(string name)

int

根据特效名返回注册的动态ID。

Reg.BuffID(string name)

int

根据BUFF名返回注册的动态ID。

Reg.EnchantmentID(string name)

int

根据附魔名返回注册的动态ID。

Reg.NpcID(string name)

int

根据NPC名返回注册的动态ID。

Reg.ProjectileID(string name)

int

根据抛射物名返回注册的动态ID。

Reg.SoundID(string name)

int

根据音效名返回注册的动态ID。

Reg.SoundGroupID(string name)

int

根据音效组名返回注册的动态ID。

Reg.LiquidID(string name)

int

根据流体名返回注册的动态ID。

Reg.SkeletonJointID(string skeletonName, string jointName)

int

根据骨骼模型名关节名返回关节在该骨骼模型注册的动态ID。

Reg.ModTextureID(string name)

int

根据模组贴图名返回注册的动态贴图ID。服务端总是返回0。

Last updated