Tool placement||doc135650

September 20, 2022

Format

 item:cfg() 
  • The class to which the function belongs:item

Description

Get item configuration information.


Value Returned

type Description
config configuration information


Code Samples

On the server side of the player entity templatemount script, add a registered player when switching handheld itemCallback, output the configuration information of the new item

Trigger.addHandler(this:cfg(), "HAND_ITEM_CHANGED", function(context)
    local entity = context.obj1
    local newItem = context.item
    Lib.pv(newItem and newItem:cfg())
  end)