API Documentation

From Space Engineers Wiki
Jump to: navigation, search

The official Modding API was introduced with Update 01.048. This is not to be confused with the SEModAPI, a community-built interface started several months earlier.

The API consists of bindings that can be accessed through C# scripts, which themselves are distributed with mods. There are a handful of Windows *.dll's which collect and organize the objects and methods used in mods. A list of each *.dll namespace with the objects and methods they expose is listed below.

Mod Whitelist

Not every function can be called in downloadable mods, to prevent malicious damage. Thus only a select few functions/classes may be called and used. The current list is as follows:

  • Current whitelist
  • NullReferenceException
  • ArgumentException
  • ArgumentNullException
  • InvalidOperationException
  • FormatException
  • System.Exception
  • System.DivideByZeroException
  • System.InvalidCastException
  • System.Math
  • System.Enum;
  • System.Int32
  • System.Int16
  • System.Int64
  • System.UInt32
  • System.UInt16
  • System.UInt64
  • System.Double
  • System.Single
  • System.Boolean
  • System.Char
  • System.Byte
  • System.SByte
  • System.Decimal
  • System.DateTime
  • System.TimeSpan
  • System.Object
  • System.IDisposable
  • System.Random
  • System.Convert
  • System.Nullable<>
  • System.IO.Stream
  • System.IO.TextWriter
  • System.IO.TextReade
  • System.Collections.IEnumerator
  • System.Collections.Generic.IEnumerable<>
  • System.Collections.Generic.HashSet<>
  • System.Collections.Generic.Queue<>
  • System.Linq.Enumerable
  • System.Text.StringBuilder
  • System.Text.RegularExpressions.Regex;
  • System.Timers.Timer;
  • System.Globalization.Calendar;
  • System.Xml.Serialization.XmlElementAttribute
  • System.Xml.Serialization.XmlAttributeAttribute
  • System.Xml.Serialization.XmlArrayAttribute
  • System.Xml.Serialization.XmlArrayItemAttribute
  • System.Xml.Serialization.XmlAnyAttributeAttribute
  • System.Xml.Serialization.XmlAnyElementAttribute
  • System.Xml.Serialization.XmlAnyElementAttributes
  • System.Xml.Serialization.XmlArrayItemAttributes
  • System.Xml.Serialization.XmlAttributeEventArgs
  • System.Xml.Serialization.XmlAttributeOverrides
  • System.Xml.Serialization.XmlAttributes
  • System.Xml.Serialization.XmlChoiceIdentifierAttribute
  • System.Xml.Serialization.XmlElementAttributes
  • System.Xml.Serialization.XmlElementEventArgs
  • System.Xml.Serialization.XmlEnumAttribute
  • System.Xml.Serialization.XmlIgnoreAttribute
  • System.Xml.Serialization.XmlIncludeAttribute
  • System.Xml.Serialization.XmlRootAttribute
  • System.Xml.Serialization.XmlTextAttribute
  • System.Xml.Serialization.XmlTypeAttribute
  • Sandbox.ModAPI.Ingame.IMyCubeBlock
  • Sandbox.ModAPI.IMySession
  • Sandbox.ModAPI.Interfaces.IMyCameraController
  • Sandbox.Common.MySessionComponentBase
  • Sandbox.Common.ObjectBuilders.MyObjectBuilder_Base
  • Sandbox.Common.ObjectBuilders.Voxels.MyObjectBuilder_VoxelMap
  • Sandbox.Common.Components.MyComponentBase
  • Sandbox.Common.Localization.MyTextsWrapper
  • Sandbox.Definitions.MyDefinitionId
  • Sandbox.Common.ObjectBuilders.VRageData.SerializableVector3
  • Sandbox.Common.ObjectBuilders.Definitions.SerializableDefinitionId
  • VRageMath.Vector3
  • VRage.Voxels.MyStorageDataCache
  • VRage.MyFixedPoint
  • VRage.Collections.ListReader<>
  • VRage.Common.Utils.MyStringId

Sandbox.Common

Classes
Name Description
BoundingBoxExtensions A class.
BoundingFrustumExtensions A class.
MyAbstractXmlSerializer<TAbstractBase> A class.
MyCuboid A class.
MyCuboidSide A class.
MyEngineConstants A class.
MyFactoryTagAttribute A class.
MyFinalBuildConstants A class.
MyMath A class.
MyMesh A class.
MyMeshMaterial A class.
MyObjectFactory<TAttribute, TCreatedObjectBase> A class.
MySessionComponentBase A class.
MySessionComponentDescriptor A class.
MyUtils2 A class.
Vector3Extensions A class.
Structs
Name Description
MyControllerData A Struct.
MyIntersectionResultLineTriangle A Struct.
MyIntersectionResultLineTriangleEx A Struct.
Interfaces
Name Description
IMyNamedComponent An Interface.
IMyTriangePruningStructure An Interface.
IMyUserInputComponent An Interface.
Enums
Name Description
Keys An Enum.
MyEntityUpdateEnum An Enum.
MyFontEnum An Enum.
MyMaterialType An Enum.
MyQuickLaunchType An Enum.
MyRelationsBetweenFactions An Enum.
MyRelationsBetweenPlayerAndBlock An Enum.
MyUpdateOrder An Enum.

Vrage.Math

Classes
Name Description
Base27Directions A class.
Base6Directions A class.
BoundingBox.ComparerType A class.
BoundingBoxD.ComparerType A class.
BoundingFrustum A class.
BoundingFrustumD A class.
ColorExtensions A class.
Curve A class.
CurveKey A class.
CurveKeyCollection A class.
DoubleExtensions A class.
FloatExtensions A class.
MathHelper A class.
MyDynamicAABBTree A class.
MyDynamicAABBTreeD A class.
MyLineSegmentOverlapResult<T>.MyLineSegmentOverlapResultComparer A class.
MyMortonCode3D A class.
Vector2I.ComparerClass A class.
Vector3I.EqualityComparer A class.
Vector3INormalEqualityComparer A class.
Vector3UByte.EqualityComparer A class.
Structs
Name Description
BoundingBox A struct.
BoundingBoxD A struct.
BoundingSphere A struct.
BoundingSphereD A struct.
Capsule A struct.
Color A struct.
Line A struct.
LineD A struct.
Matrix A struct.
MatrixD A struct.
MatrixI A struct.
MyBlockOrientation A struct.
MyBounds A struct.
MyLineSegmentOverlapResult<T> A struct.
MyOrientedBoundingBox A struct.
MyQuad A struct.
MyShort4 A struct.
MyTransform A struct.
MyUShort4 A struct.
Plane A struct.
PlaneD A struct.
Point A struct.
Quaternion A struct.
Ray A struct.
RayD A struct.
Rectangle A struct.
RectangleF A struct.
Vector2 A struct.
Vector2I A struct.
Vector3 A struct.
Vector3B A struct.
Vector3D A struct.
Vector3I A struct.
Vector3I.RangeIterator A struct.
Vector3S A struct.
Vector3UByte A struct.
Vector3Ushort A struct.
Vector4 A struct.
Vector4I A struct.
Vector4UByte A struct.
Enums
Name Description
Base27Directions.Direction An enum.
Base6Directions.Axis An enum.
Base6Directions.Direction An enum.
ContainmentType An enum.
CurveContinuity An enum.
CurveLoopType An enum.
CurveTangent An enum.
PlaneIntersectionType An enum.

Vrage.Library

Classes
Name Description
ByteStream A class
ConstructorHelper<T> A class
Crc32 A class
DateTimeExtensions A class
DirectoryExtensions A class
EnumComparer<TEnum> A class
Exceptions A class
FastNoArgsEvent A class
FastResourceLock A class
FastResourceLockExtensions A class
InstanceComparer<T> A class
MemberHelper A class
MemberHelper<T> A class
MyCompression A class
MyCompressionFileLoad A class
MyCompressionFileSave A class
MyCompressionStreamLoad A class
MyCompressionStreamSave A class
MyEnum<T> A class
MyGameTimer A class
MyRandom A class
ResetableMemoryStream A class
TimeUtil A class
Structs
Name Description
FastResourceLock.Statistics A struct.
FastResourceLockExtensions.MyExclusiveLock A struct.
FastResourceLockExtensions.MySharedLock A struct.
<T>.MaxValue A struct.
MyFixedPoint A struct.
MyRandom.State A struct.
MyRandom.StateToken A struct.
MyTimeSpan A struct.
MyTuple A struct.
MyTuple<T1> A struct.
MyTuple<T1, T2> A struct.
MyTuple<T1, T2, T3> A struct.
MyTuple<T1, T2, T3, T4> A struct.
MyTuple<T1, T2, T3, T4, T5> A struct.
MyTuple<T1, T2, T3, T4, T5, T6> A struct.
Interfaces
Name Description
IMyCompressionLoad An interface.
IMyCompressionSave An interface.
IResourceLock An interface.
Enums
Name Description
MyNoArgsDelegate An enum.