LuaItemPrototype

class LuaItemPrototype
has_flag(flag) → boolean Does this prototype have a flag enabled?
valid :: boolean [R] Is this object valid?
type :: string [R] Type of this prototype.
name :: string [R] Name of this prototype.
localised_name :: LocalisedString [R]
stack_size :: uint [R] Maximum stack size of the item specified by this prototype.
fuel_value :: float [R] Fuel value when burned.
order :: string [R] Order string.
group :: LuaGroup [R] The group this prototype belongs to.
subgroup :: LuaGroup [R] The subgroup this prototype belongs to.
place_result :: LuaEntityPrototype [R] Prototype of the entity that will be created by placing this item, or nil if there is no such entity.
speed :: float [R] Mining or repairing speed if this is a mining or repairing tool; otherwise nil.
magazine_size :: float [R] Size of full magazine; nil if this is not an ammo item.
default_request_amount :: uint [R] The default request value.
resistances :: Resistances [R] Resistances of this armour item; nil if not an armour.
item_to_clear :: LuaItemPrototype [R] Item required to clear this blueprint; nil if this is not a blueprint.
stackable :: boolean [R] Is this item allowed to stack at all?
module_effects [R] Effects of this module; nil if this is not a module.

Prototype of an item.

Example
game.item_prototypes["iron-plate"]
has_flag(flag) → boolean

Does this prototype have a flag enabled?

Parameters
flag :: string: The flag to check. Can be either "goes-to-main-inventory", "goes-to-quickbar" or "hidden". Any other value will cause an error.
valid :: boolean [Read-only]

Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.

type :: string [Read-only]

Type of this prototype. E.g. "gun" or "mining-tool".

name :: string [Read-only]

Name of this prototype.

localised_name :: LocalisedString [Read-only]

stack_size :: uint [Read-only]

Maximum stack size of the item specified by this prototype.

fuel_value :: float [Read-only]

Fuel value when burned.

order :: string [Read-only]

Order string.

group :: LuaGroup [Read-only]

The group this prototype belongs to.

subgroup :: LuaGroup [Read-only]

The subgroup this prototype belongs to.

place_result :: LuaEntityPrototype [Read-only]

Prototype of the entity that will be created by placing this item, or nil if there is no such entity.

speed :: float [Read-only]

Mining or repairing speed if this is a mining or repairing tool; otherwise nil.

magazine_size :: float [Read-only]

Size of full magazine; nil if this is not an ammo item.

default_request_amount :: uint [Read-only]

The default request value.

resistances :: Resistances [Read-only]

Resistances of this armour item; nil if not an armour.

item_to_clear :: LuaItemPrototype [Read-only]

Item required to clear this blueprint; nil if this is not a blueprint.

stackable :: boolean [Read-only]

Is this item allowed to stack at all?

module_effects [Read-only]

Effects of this module; nil if this is not a module.

Can only be used if this is ModuleItem