Get entity configuration||doc135541

September 20, 2022


  • The class to which the function belongs:Entity


Get the configuration information of the entity object.


Variable name type Description
cfgName string Configuration name

Value Returned

type Description
config configuration information

Code Samples

Find the corresponding entity in the editor, right-click to copy its ID, plus the prefix is its configuration name, such as 'myplugin/player1'

on the server sideglobal script, add the register when the entity object of this class enters the gameCallbackbroadcast tipsthe object's name

local cfg = Entity.GetCfg("myplugin/player1")
Trigger.addHandler(cfg, "ENTITY_ENTER", function(context)
    local entity = context.obj1
    World.CurWorld.SystemNotice(1,, 40)    --Broadcast object name