Modding:Lua/Tables/FireableItem
The fireableItem table contains bindings which provide functionality for the .tillingtool, .beamaxe, .miningtool, .harvestingtool, .codex, .blueprint, .paintingtool, .wiretool, .unlock, .consumable, .thrownitem, .matitem, and .liqitem item types.
It has access to the config, item, root, sb, and world tables.
Vec2F
fireableItem.ownerAimPosition()
Returns the world aim position of the owner entity.
json
fireableItem.fireableParam([String
parameter][Json
defauly])
Returns the value for the specified config parameter. If there is no value set, returns the default. This does what config.getParameter does, so use that instead because the fireableItem table is probably cursed or something.
void
fireableItem.triggerCooldown()
Begins the cooldown, preventing the item from being used.
void
fireableItem.fire([String
fireMode])
Fires the item, just like pressing LMB (primary) or RMB (alt). Defaults to primary if not set.
String
fireableItem.fireMode()
Returns the last fire mode of the item, which can be "none", "primary" or "alt". Single-handed items held in the off hand will receive right click as "primary" rather than "alt".
void
fireableItem.endCooldown()
Ends the cooldown, allowing the item to be fired again.
bool
fireableItem.ownerEnergyLocked()
Returns if the toolUser's energy resource is locked.
bool
fireableItem.coolingDown()
Returns if the item is undergoing cooldown.
bool
fireableItem.ownerEnergy()
Returns whether the 'energy' resource exists in this toolUser's status controller. Huh? Were you expecting status.stat or something?
bool
fireableItem.windingUp()
Returns if the item is being winded up (ie: pickaxe swinging).
void
fireableItem.setCooldown([float
cooldown])
Sets the cooldown time for the item, in seconds.
This only works once per item file/item name, so if you don't want to wait, just unequip the item and equip it again. Who knows, maybe every copy of fireableItem.setCooldown is personalized for each copy of Starbound?
bool
fireableItem.ownerFullEnergy()
Probably returns if the toolUser entity has full energy.
bool
fireableItem.firing()
Returns if the fireable item is firing.
float
fireableItem.cooldownTime()
Returns the fireable item's cooldown time.
bool
fireableItem.ownerConsumeEnergy([float
energy])
Attempts to consume <float> amount of the toolUser's energy. Returns whether any energy was consumed. Unlike status.consumeResource, it will consume more energy than the player has (which isn't different than consuming the amount of energy they have because energy can't go below zero).
void
fireableItem.setFireableParam([String
parameter][?
value])
Presumably a knock-off of activeItem.setInstanceValue. It doesn't work, by the way. But it exists in the game's coding!
Unless proven otherwise, I'm going to say that it exists solely to mock us.
Portal - Basics - JSON - Lua - Assets - Guides
Tables - Hooks - Tips & Tricks - Libraries - All Pages