PasswordPermissionModule API
PasswordPermissionModule is a Logiscript-native permission block that complements StarMade’s built-in PUBLIC_PERMISSION_MODULE (346) and FACTION_PERMISSION_MODULE (936).
When placed adjacent to any block that uses StarMade’s permission system — or adjacent to a DataStore — it gates access behind a password that a computer script must supply. Authentication is faction-scoped and time-limited (5 minutes by default).
How it works
A computer on the same entity as the module sets the password via
setPassword().Any computer in any faction calls
auth("password")to authenticate.On success, the computer’s faction is registered as authenticated for 5 minutes.
During that window, the authenticated faction can:
Access adjacent
DataStoreblocks (viadatastore:auth()or directcheckAccess)Activate adjacent console blocks (via StarMade’s permission event)
Dock to / interact with blocks gated by this module (rail, beam, shipyard)
Typical usage
-- On a setup computer (same entity as the module):
local ppm = console.getBlock():getEntity():getBlockAt(vec3i(0, 1, 0)):wrapAs("passwordmodule")
ppm:setPassword("secret")
-- On any other computer (possibly a different entity):
local ppm = block.wrapAs(nearbyModulePiece, "passwordmodule")
if ppm:auth("secret") then
print("Authenticated for 5 minutes")
end
-- Check current auth state:
print(ppm:isAuthed()) -- true/false
-- Revoke auth early:
ppm:deauth()
Reference
auth(password: String)Verifiespasswordagainst this module’s stored hash. On success, registers the calling computer’s faction in the auth manager and returnstrue. If no password is configured, any call toauth()succeeds.deauth()Immediately revokes the calling computer’s faction auth for this module.isAuthed()Returnstrueif the calling computer’s faction is currently authenticated.setPassword(password: String)Sets the password for this module. Requires the computer to be on the same entity as the module. Passnilor""to clear the password.clearPassword()Removes the password, making the module grant access to any faction that callsauth()regardless of what they pass. Requires same-entity computer.isProtected()Returnstruewhen a password is currently configured on this module.
Integration
The PasswordPermissionModule integrates with StarMade’s BlockPublicPermissionEvent,
which fires for:
Rail docking checks
Personal beam targeting
Shipyard access
Console block activation
Any of these operations on a block adjacent to a PasswordPermissionModule will
succeed if the accessing entity’s faction has previously authenticated via auth().
Notes
Auth state is in-memory only and does not survive server restarts.
Auth is faction-scoped: one computer authenticating grants access to all computers in the same faction for the duration of the TTL.
Faction ID
0(no faction) is never granted auth.Password configuration requires a computer physically on the same entity as the module.