Shipyard API
Shipyard exposes build/undock state and shipyard command control.
Reference
isFinished()Returnstruewhen the current build or refit is complete.getCompletion()Returns build progress as aDouble(0.0–1.0).isDocked()Returnstruewhen a ship is physically docked in the shipyard.isVirtualDocked()Returnstruewhen a blueprint ship is virtually docked (pre-build state).getDocked()Returns the currently docked ship as anEntity, ornil.canUndock()Returnstruewhen undocking is currently permitted.undock()Releases the docked ship from the shipyard.getRequired()Returns the resources required to complete the build asItemStack[].getCurrent()Returns the resources currently loaded into the shipyard asItemStack[].getNeeded()Returns the difference between required and current resources asItemStack[].sendCommand(command: String, ...)Sends a shipyard server command when the build is finished.
Invalid command names, wrong argument counts, or calls made before the shipyard is ready now raise clear errors instead of failing silently.
Common argument shapes:
CREATE_NEW_DESIGN(command, name)expectsname: String.LOAD_DESIGN(command, slot)expectsslot: Integer.SPAWN_DESIGN(command, name)expectsname: String.CATALOG_TO_DESIGN(command, owner, design)expectsowner: Stringanddesign: String.BLUEPRINT_TO_DESIGN(command, owner, blueprint)expectsowner: Stringandblueprint: String.DESIGN_TO_BLUEPRINT(command, name, factionId, style)expectsname: String,factionId: Integer, andstyle: Integer.TEST_DESIGN(command, slot)andREPAIR_FROM_DESIGN(command, slot)each expectslot: Integer.UNLOAD_DESIGNandDECONSTRUCT_RECYCLEtake no extra arguments.
See the command table below for the full signature list.
Command names
These are the ShipyardCommandType enum names present in the current StarMade build used by Logiscript:
Command name |
Expected args |
Notes |
|---|---|---|
|
|
Create a new shipyard design |
|
|
Unload the current design |
|
|
Load an existing design |
|
|
Deconstruct the docked ship |
|
|
Deconstruct and recycle materials |
|
|
Spawn the active design |
|
|
Load from catalog into design state |
|
|
Load from blueprint into design state |
|
|
Save the current design as a blueprint |
|
|
Spawn/test the current design |
|
|
Repair from the active design |
Argument types are the current upstream StarMade command signatures exposed through sendCommand(command, ...).
sendCommand(command, ...) expects one of these exact enum names.