Enumeration: ContainerRulesErrorReason
inventory errorBeta
抛出 @minecraft/server.ContainerRulesError 的原因。
Reasons that the @minecraft/server.ContainerRulesError was thrown.
Enumeration Members
BannedItem
BannedItem:
"BannedItem"
Beta
Remarks
当尝试添加已在 ContainerRules.bannedItems 中定义的物品时抛出。
Thrown when trying to add item that was defined in ContainerRules.bannedItems.
NestedStorageItem
NestedStorageItem:
"NestedStorageItem"
Beta
Remarks
当尝试将带有 Storage Item 组件的物品添加到 ContainerRules.allowNestedStorageItems 设置为 false 的容器时抛出。
Thrown when trying to add item with Storage Item component
to container with ContainerRules.allowNestedStorageItems set to false.
NotAllowedItem
NotAllowedItem:
"NotAllowedItem"
Beta
Remarks
当尝试添加未在非空 ContainerRules.allowedItems 中定义的物品时抛出。
Thrown when trying to add item not defined in non-empty ContainerRules.allowedItems.
OverWeightLimit
OverWeightLimit:
"OverWeightLimit"
Beta
Remarks
当尝试添加物品导致容器重量超过 ContainerRules.weightLimit 时抛出。
Thrown when trying to add item that pushed the containers weight over the ContainerRules.weightLimit.
ZeroWeightItem
ZeroWeightItem:
"ZeroWeightItem"
Beta
Remarks
当尝试添加由 Storage Weight Modifier 组件定义为零重量的物品到具有定义的 ContainerRules.weightLimit 的容器时抛出。
Thrown when trying to add item with zero weight defined by
the Storage Weight Modifier component to container with a
defined ContainerRules.weightLimit
