引用API
BlockEntityRef
类成员属性
属性
类型
描述
BlockEntityRef.ref
BlockEntity/nil
返回引用的方块实体对象,若对象不存在或为空引用则返回nil。
类成员函数
函数
返回值
描述
BlockEntityRef:SetRef(BlockEntity e)
void
设置当前引用指向指定方块实体,传入nil表示空引用。
NpcRef
类成员属性
属性
类型
描述
NpcRef.ref
Npc/nil
返回引用的NPC对象,若对象不存在或为空引用则返回nil。
类成员函数
函数
返回值
描述
NpcRef:SetRef(Npc e)
void
设置当前引用指向指定NPC,传入nil表示空引用。
ProjectileRef
类成员属性
属性
类型
描述
ProjectileRef.ref
Projectile/nil
返回引用的抛射物对象,若对象不存在或为空引用则返回nil。
类成员函数
函数
返回值
描述
ProjectileRef:SetRef(Projectile e)
void
设置当前引用指向指定抛射物,传入nil表示空引用。
PlayerRef
类成员属性
属性
类型
描述
PlayerRef.ref
Player/nil
返回引用的玩家对象,若对象不存在或为空引用则返回nil。
类成员函数
函数
返回值
描述
PlayerRef:SetRef(Player e)
void
设置当前引用指向指定玩家,传入nil表示空引用。
Last updated
Was this helpful?