Click or drag to resize
IMyCubeBlock Interface

[This is preliminary documentation and is subject to change.]

base block interface, block can be affected by upgrade modules, and you can retrieve upgrade list from [!:IMyUpgradableBlock]

Namespace: VRage.Game.ModAPI
Assembly: VRage.Game (in VRage.Game.dll) Version: 1.0.0.0
Syntax
C#
public interface IMyCubeBlock : IMyCubeBlock, 
	IMyEntity

The IMyCubeBlock type exposes the following members.

Properties
  NameDescription
Public propertyBlockDefinition
Public propertyCastShadows (Inherited from IMyEntity.)
Public propertyCheckConnectionAllowed
Whether the grid should call the ConnectionAllowed method for this block (ConnectionAllowed checks mount points and other per-block requirements)
Public propertyClosed (Inherited from IMyEntity.)
Public propertyComponents (Inherited from IMyEntity.)
Public propertyCubeGrid
Grid in which the block is placed
Public propertyDebugAsyncLoading (Inherited from IMyEntity.)
Public propertyDefinitionDisplayNameText
Definition name
Public propertyDisassembleRatio
Is set in definition Ratio at which is the block disassembled (grinding)
Public propertyDisplayName (Inherited from IMyEntity.)
Public propertyDisplayNameText
Translated block name
Public propertyEntityId (Inherited from IMyEntity.)
Public propertyFastCastShadowResolve (Inherited from IMyEntity.)
Public propertyFlags (Inherited from IMyEntity.)
Public propertyGameLogic (Inherited from IMyEntity.)
Public propertyHierarchy (Inherited from IMyEntity.)
Public propertyInScene (Inherited from IMyEntity.)
Public propertyInvalidateOnMove (Inherited from IMyEntity.)
Public propertyIsBeingHacked
Public propertyIsCCDForProjectiles (Inherited from IMyEntity.)
Public propertyIsFunctional
True if integrity is above breaking threshold
Public propertyIsVolumetric (Inherited from IMyEntity.)
Public propertyIsWorking
True if block is able to do its work depening on block type (is functional, powered, enabled, etc...)
Public propertyLocalAABB (Inherited from IMyEntity.)
Public propertyLocalAABBHr (Inherited from IMyEntity.)
Public propertyLocalMatrix (Inherited from IMyEntity.)
Public propertyLocalVolume (Inherited from IMyEntity.)
Public propertyLocalVolumeOffset (Inherited from IMyEntity.)
Public propertyLocationForHudMarker (Inherited from IMyEntity.)
Public propertyMarkedForClose (Inherited from IMyEntity.)
Public propertyMass
Block mass
Public propertyMax
Maximum coordinates of grid cells occupied by this block
Public propertyMaxGlassDistSq (Inherited from IMyEntity.)
Public propertyMin
Minimum coordinates of grid cells occupied by this block
Public propertyName (Inherited from IMyEntity.)
Public propertyNearFlag (Inherited from IMyEntity.)
Public propertyNeedsDraw (Inherited from IMyEntity.)
Public propertyNeedsDrawFromParent (Inherited from IMyEntity.)
Public propertyNeedsResolveCastShadow (Inherited from IMyEntity.)
Public propertyNeedsUpdate (Inherited from IMyEntity.)
Public propertyNumberInGrid
Order in which were the blocks of same type added to grid Used in default display name
Public propertyOrientation
Returns block orientation in base 6 directions
Public propertyOwnerId
Id of player owning block (not steam Id)
Public propertyParent (Inherited from IMyEntity.)
Public propertyPersistentFlags (Inherited from IMyEntity.)
Public propertyPhysics (Inherited from IMyEntity.)
Public propertyPosition
Position in grid coordinates
Public propertyPositionComp (Inherited from IMyEntity.)
Public propertyRender (Inherited from IMyEntity.)
Public propertySave (Inherited from IMyEntity.)
Public propertyShadowBoxLod (Inherited from IMyEntity.)
Public propertySkipIfTooSmall (Inherited from IMyEntity.)
Public propertySyncObject (Inherited from IMyEntity.)
Public propertyTransparent (Inherited from IMyEntity.)
Public propertyUpgradeValues
Get all values changed by upgrade modules Should only be used as read-only
Public propertyVisible (Inherited from IMyEntity.)
Public propertyWorldAABB (Inherited from IMyEntity.)
Public propertyWorldAABBHr (Inherited from IMyEntity.)
Public propertyWorldMatrix (Inherited from IMyEntity.)
Public propertyWorldMatrixInvScaled (Inherited from IMyEntity.)
Public propertyWorldMatrixNormalizedInv (Inherited from IMyEntity.)
Public propertyWorldVolume (Inherited from IMyEntity.)
Public propertyWorldVolumeHr (Inherited from IMyEntity.)
Top
Methods
  NameDescription
Public methodAddToGamePruningStructure (Inherited from IMyEntity.)
Public methodAddUpgradeValue
Preferred way of registering a block for upgrades Adding directly to the dictionary can have unintended consequences when multiple mods are involved.
Public methodBeforeSave (Inherited from IMyEntity.)
Public methodCalcLocalMatrix
Public methodCalculateCurrentModel
Calculates model currently used by block depending on its build progress and other factors
Public methodClose (Inherited from IMyEntity.)
Public methodDebugDraw
Debug only method. Effects may wary through time.
Public methodDebugDrawInvalidTriangles (Inherited from IMyEntity.)
Public methodDelete (Inherited from IMyEntity.)
Public methodDoOverlapSphereTest (Inherited from IMyEntity.)
Public methodEnableColorMaskForSubparts (Inherited from IMyEntity.)
Public methodGetChildren (Inherited from IMyEntity.)
Public methodGetDiffuseColor (Inherited from IMyEntity.)
Public methodGetDistanceBetweenCameraAndBoundingSphere (Inherited from IMyEntity.)
Public methodGetDistanceBetweenCameraAndPosition (Inherited from IMyEntity.)
Public methodGetFriendlyName (Inherited from IMyEntity.)
Public methodGetIntersectionWithLineAndBoundingSphere (Inherited from IMyEntity.)
Public methodGetIntersectionWithSphere (Inherited from IMyEntity.)
Public methodGetLargestDistanceBetweenCameraAndBoundingSphere (Inherited from IMyEntity.)
Public methodGetObjectBuilder (Inherited from IMyEntity.)
Public methodGetObjectBuilderCubeBlock
Returns block object builder which can be serialized or added to grid
Public methodGetOwnerFactionTag
Public methodGetPlayerRelationToOwner
Public methodGetPosition (Inherited from IMyEntity.)
Public methodGetSmallestDistanceBetweenCameraAndBoundingSphere (Inherited from IMyEntity.)
Public methodGetSubpart (Inherited from IMyEntity.)
Public methodGetTopMostParent (Inherited from IMyEntity.)
Public methodGetTrianglesIntersectingSphere (Inherited from IMyEntity.)
Public methodGetUserRelationToOwner
Public methodGetViewMatrix (Inherited from IMyEntity.)
Public methodGetWorldMatrixNormalizedInv (Inherited from IMyEntity.)
Public methodInit
Reloads block model and interactive objects (doors, terminals, etc...)
Public methodInit(MyObjectBuilder_CubeBlock, IMyCubeGrid)
Initializes block state from object builder
Public methodIsVisible (Inherited from IMyEntity.)
Public methodOnAddedToScene (Inherited from IMyEntity.)
Public methodOnBuildSuccess
Method called when a block has been built (after adding to the grid). This is called right after placing the block and it doesn't matter whether it is fully built (creative mode) or is only construction site. Note that it is not called for blocks which do not create FatBlock at that moment.
Public methodOnDestroy
Called when block is destroyed before being removed from grid
Public methodOnModelChange
Called when the model referred by the block is changed
Public methodOnRegisteredToGridSystems
Called at the end of registration from grid systems (after block has been registered).
Public methodOnRemovedByCubeBuilder
Method called when user removes a cube block from grid. Useful when block has to remove some other attached block (like motors).
Public methodOnRemovedFromScene (Inherited from IMyEntity.)
Public methodOnUnregisteredFromGridSystems
Called at the end of unregistration from grid systems (after block has been unregistered).
Public methodRaycastDetectors
Gets the name of interactive object intersected by defined line
Public methodReloadDetectors
Reloads detectors (interactive objects) in model
Public methodRemoveFromGamePruningStructure (Inherited from IMyEntity.)
Public methodSetColorMaskForSubparts (Inherited from IMyEntity.)
Public methodSetDamageEffect
Start or stop dammage effect on cube block
Public methodSetEmissiveParts
Sets the emissive value of a specific emissive material on entity.
(Inherited from IMyEntity.)
Public methodSetEmissivePartsForSubparts
Sets the emissive value of a specific emissive material on all entity subparts.
(Inherited from IMyEntity.)
Public methodSetLocalMatrix (Inherited from IMyEntity.)
Public methodSetPosition (Inherited from IMyEntity.)
Public methodSetWorldMatrix (Inherited from IMyEntity.)
Public methodTryGetSubpart (Inherited from IMyEntity.)
Public methodUpdateGamePruningStructure (Inherited from IMyEntity.)
Public methodUpdateIsWorking
Force refresh working state. Call if you change block state that could affect its working status.
Public methodUpdateVisual
Updates block visuals (ie. block emissivity)
Top
Events
  NameDescription
Public eventIsWorkingChanged
Public eventOnClose (Inherited from IMyEntity.)
Public eventOnClosing (Inherited from IMyEntity.)
Public eventOnMarkForClose (Inherited from IMyEntity.)
Public eventOnPhysicsChanged (Inherited from IMyEntity.)
Public eventOnUpgradeValuesChanged
Event called when upgrade values are changed Either upgrades were built or destroyed, or they become damaged or unpowered
Top
See Also