TechbloxModdingAPI
v2.2.0
The unofficial Techblox modding API
|
An in-game player character. Any Leo you see is a player. More...
Public Member Functions | |
Player (PlayerType player) | |
Initializes a new instance of the T:TechbloxModdingAPI.Player class. More... | |
Player (uint id) | |
Initializes a new instance of the T:TechbloxModdingAPI.Player class. More... | |
bool | DespawnMachine () |
Despawn the player's machine in time running mode and place it in their hand. More... | |
void | EnterSeat (Seat seat) |
Enter the given seat. More... | |
bool | Equals (EGID other) |
override bool | Equals (object obj) |
bool | Equals (Player other) |
void | ExitSeat () |
Exit the seat the player is currently in. More... | |
Block | GetBlockLookedAt (float maxDistance=-1f) |
Returns the block the player is currently looking at in build mode. More... | |
Block | GetGhostBlock () |
Returns the ghost block that shows the block to be placed in build mode. More... | |
override int | GetHashCode () |
Block[] | GetSelectedBlocks () |
Returns the blocks that are in the player's current selection. More... | |
SimBody | GetSimBodyLookedAt (float maxDistance=-1f) |
Returns the rigid body the player is currently looking at during simulation. More... | |
Wire | GetWireLookedAt (float maxDistance=-1f) |
Returns the wire the player is currently looking at in build mode. More... | |
bool | SpawnMachine () |
Spawn the machine the player is holding in time running mode. More... | |
void | Teleport (float x, float y, float z, bool relative=true, bool exitSeat=true) |
Teleport the player to the specified coordinates. More... | |
override string | ToString () |
Static Public Member Functions | |
static uint | Count () |
The amount of Players in the current game. More... | |
static bool | Exists (PlayerType player) |
Checks if the specified player exists. More... | |
static bool | Exists (uint player) |
Checks if the specified player exists. More... | |
Public Attributes | |
PlayerBuildingMode | BuildingMode |
The player's mode in time stopped mode, determining what they place. More... | |
float | Mass => 0 |
The player's mass. More... | |
PlayerState | State |
Static Package Functions | |
static Player | GetInstance (uint id) |
static T | GetInstance< T > (EGID egid, Func< EGID, T > constructor, Type type=null) |
Returns a cached instance if there's an actively used instance of the object already. Objects still get garbage collected and then they will be removed from the cache. More... | |
static WeakDictionary< EGID, EcsObjectBase > | GetInstances (Type type) |
static void | Init () |
Package Attributes | |
EcsInitData | InitData |
WrappedHandler< PlayerSeatEventArgs > | seatEntered |
WrappedHandler< PlayerSeatEventArgs > | seatExited |
Static Package Attributes | |
static WrappedHandler< PlayerEventArgs > | joined |
static WrappedHandler< PlayerEventArgs > | left |
Properties | |
float?? | AccelerationSetting [get, set] |
The acceleration setting of the player. Build mode (camera) and simulation mode settings are separate. More... | |
float3 | AngularVelocity [get, set] |
The player's current angular velocity. More... | |
float? | CurrentHealth [get, set] |
The player's current health in Simulation (aka Time Running) mode. More... | |
uint? | CurrentLives [get, set] |
The player's current lives in Simulation (aka Time Running) mode. More... | |
bool | Damageable [get, set] |
Whether this T:TechbloxModdingAPI.Player is damageable. More... | |
bool | Dead [get] |
Whether the player is dead. If true , hopefully it was quick. More... | |
new uint | Id [get] |
The player's unique identifier. More... | |
float? | InitialHealth [get, set] |
The player's initial health when entering Simulation (aka Time Running) mode. More... | |
uint? | InitialLives [get, set] |
The player's lives when initially entering Simulation (aka Time Running) mode. More... | |
static Player | LocalPlayer [get] |
Returns the current player belonging to this client. It will be different after entering/leaving simulation. May return null if the local player doesn't exist. More... | |
float | Ping [get] |
The player's latest network ping time. More... | |
float3 | Position [get, set] |
The player's current position. More... | |
float3?? | Rotation [get, set] |
The player's current rotation. More... | |
BlockIDs? | SelectedBlock [get] |
The player's selected block ID in their hand. More... | |
Blueprint???? | SelectedBlueprint [get, set] |
The player's selected blueprint in their hand. Set to null to clear. Dispose after usage. More... | |
BlockColor? | SelectedColor [get] |
The player's selected block color in their hand. More... | |
BlockColor? | SelectedColour [get] |
The player's selected block colour in their hand. More... | |
float?? | SpeedSetting [get, set] |
Movement speed setting. Build mode (camera) and simulation mode settings are separate. More... | |
float?? | SpeedSprintMultiplierSetting [get, set] |
The multiplier setting to use when sprinting. Build mode (camera) and simulation mode settings are separate. More... | |
bool?? | Sprinting [get, set] |
Whether the player is sprinting. More... | |
PlayerType | Type [get] |
The player's type. The player type is always relative to the current client, not the game host. More... | |
float3 | Velocity [get, set] |
The player's current velocity. More... | |
Events | |
static EventHandler< PlayerEventArgs > | Joined [add, remove] |
static EventHandler< PlayerEventArgs > | Left [add, remove] |
EventHandler< PlayerSeatEventArgs > | SeatEntered [add, remove] |
EventHandler< PlayerSeatEventArgs > | SeatExited [add, remove] |
An in-game player character. Any Leo you see is a player.
|
inline |
Initializes a new instance of the T:TechbloxModdingAPI.Player class.
id | The player's unique identifier. |
|
inline |
Initializes a new instance of the T:TechbloxModdingAPI.Player class.
player | The player type. Chooses the first available player matching the criteria. |
|
inlinestatic |
The amount of Players in the current game.
|
inline |
Despawn the player's machine in time running mode and place it in their hand.
|
inline |
Enter the given seat.
seat | The seat to enter. |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Checks if the specified player exists.
player | Player type. |
|
inlinestatic |
Checks if the specified player exists.
player | The player's unique identifier. |
|
inline |
Exit the seat the player is currently in.
|
inline |
Returns the block the player is currently looking at in build mode.
maxDistance | The maximum distance from the player (default is the player's building reach) |
|
inline |
Returns the ghost block that shows the block to be placed in build mode.
|
inline |
|
inlinestaticpackage |
|
inlinestaticpackageinherited |
Returns a cached instance if there's an actively used instance of the object already. Objects still get garbage collected and then they will be removed from the cache.
egid | The EGID of the entity |
constructor | The constructor to construct the object |
T | The object type |
T | : | EcsObjectBase |
|
inlinestaticpackageinherited |
|
inline |
Returns the blocks that are in the player's current selection.
|
inline |
Returns the rigid body the player is currently looking at during simulation.
maxDistance | The maximum distance from the player (default is the player's building reach) |
|
inline |
Returns the wire the player is currently looking at in build mode.
maxDistance | The maximum distance from the player (default is the player's building reach) |
|
inlinestaticpackage |
|
inline |
Spawn the machine the player is holding in time running mode.
|
inline |
Teleport the player to the specified coordinates.
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
relative | If set to true teleport relative to the player's current position. |
exitSeat | If set to true exit any seat the player is in. |
|
inline |
PlayerBuildingMode TechbloxModdingAPI.Player.BuildingMode |
The player's mode in time stopped mode, determining what they place.
|
packageinherited |
|
staticpackage |
|
staticpackage |
float TechbloxModdingAPI.Player.Mass => 0 |
The player's mass.
The mass.
|
package |
|
package |
PlayerState TechbloxModdingAPI.Player.State |
|
getset |
The acceleration setting of the player. Build mode (camera) and simulation mode settings are separate.
|
getset |
The player's current angular velocity.
The angular velocity.
|
getset |
The player's current health in Simulation (aka Time Running) mode.
The current health.
|
getset |
The player's current lives in Simulation (aka Time Running) mode.
The current lives.
|
getset |
Whether this T:TechbloxModdingAPI.Player is damageable.
true
if damageable; otherwise, false
.
|
get |
Whether the player is dead. If true
, hopefully it was quick.
true
if dead; otherwise, false
.
|
get |
The player's unique identifier.
The identifier.
|
getset |
The player's initial health when entering Simulation (aka Time Running) mode.
The initial health.
|
getset |
The player's lives when initially entering Simulation (aka Time Running) mode.
The initial lives.
|
staticget |
Returns the current player belonging to this client. It will be different after entering/leaving simulation. May return null if the local player doesn't exist.
|
get |
The player's latest network ping time.
The ping (s).
|
getset |
The player's current position.
The position.
|
getset |
The player's current rotation.
The rotation.
|
get |
The player's selected block ID in their hand.
The selected block.
|
getset |
The player's selected blueprint in their hand. Set to null to clear. Dispose after usage.
|
get |
The player's selected block color in their hand.
The selected block's color.
|
get |
The player's selected block colour in their hand.
The selected block's colour.
|
getset |
Movement speed setting. Build mode (camera) and simulation mode settings are separate.
|
getset |
The multiplier setting to use when sprinting. Build mode (camera) and simulation mode settings are separate.
|
getset |
Whether the player is sprinting.
|
get |
The player's type. The player type is always relative to the current client, not the game host.
The enumerated player type.
|
getset |
The player's current velocity.
The velocity.
|
staticaddremove |
|
staticaddremove |
|
addremove |
|
addremove |