Maximum capacity||doc135675

September 20, 2022


  • The class to which the function belongs:tray


Returns the maximum capacity of the tray. If the tray does not have a maximum capacity set, the tray capacity will be used as the maximum capacity by default.

Value Returned

type Description
int Maximum capacity

Code Samples

On the server side of the entity templatemount script, add the registration of this type of entity object tray when adding itemCallback, output the maximum capacity of the tray

Trigger.addHandler(this:cfg(), "SETTLE_ITEM", function(context)
    local entity = context.obj1
    local tray = context.tray
    local maxCapacity = tray:max_capacity()