MCBlock
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
Casters
Result type | Is Implicit |
---|---|
Result type MCItemDefinition | Is Implicit false |
Result type string | Is Implicit false |
Methods
Gets the Item representation of this Block.
NOTE: Not all Blocks have Items, for instance, a Lit Redstone Lamp does not have an Item.
Returns: The Item representation of this Block.
Return Type: MCItemDefinition
Checks if entities can collide with this Block.
Returns: True if entities will collide with this Block. False otherwise.
Return Type: boolean
Checks if an entity can be spawned inside this Block.
This is used to find valid spawn locations for players.
Returns: True if an entity can be spawned in this Block. False Otherwise.
Return Type: boolean
Gets the blast resistance of this Block.
Returns: The blast resistance of this Block.
Return Type: float
Gets the block bracket handler syntax for this Block.
E.G.
block:minecraft:dirt
Returns: The block bracket handler syntax for this Block.
Return Type: string
Gets the default MCBlockState of this Block.
Returns: The default MCBlockState of this Block.
Return Type: MCBlockState
Gets the harvest level for this Block.
NOTE: This will get the level for the default blockstate, you should use the BlockState specific method for a more accurate result!
Returns: The harvest tool for this Block.
Return Type: int
Gets the harvest tool for this Block.
NOTE: This will get the tool for the default blockstate, you should use the BlockState specific method for a more accurate result!
Returns: The harvest tool for this Block.
Return Type: ToolType?
Gets the jump factor of this Block.
Returns: The jump factor of this Block.
Return Type: float
Gets the loot table id for this Block.
Returns: The loot table id for this Block.
Return Type: string
Gets the material of this Block.
Returns: The material of this Block.
Return Type: MCMaterial
Gets the registry name of this block.
Returns: A ResourceLocation of the registry name of this block.
Return Type: MCResourceLocation
Gets the slipperiness of this Block.
Returns: The Slipperiness of this Block.
Return Type: float
Gets the speed factor of this Block.
Returns: The speed factor of this Block.
Return Type: float
Gets the translation key that is used to localize this Block.
Returns: The unlocalized name of this block.
Return Type: string
Gets a list of valid MCBlockStates for this Block.
Returns: A list of valid MCBlockStates for this Block.
Return Type: stdlib.List<MCBlockState>
Checks if the opacity of this block is different in different areas of the Block.
Returns: True if this Block has variable opacity. False otherwise.
Return Type: boolean
Checks whether this Block matches another Block.
Returns: True if this Block matches the other Block. False otherwise.
Return Type: boolean
Parameter | Type | Description |
---|---|---|
Parameter other | Type MCBlock | Description The other Block to check if this Block matches. |
Sets the blast resistance of this Block.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter resistance | Type float | Description The new blast resistance of this Block. |
Sets whether entities can collide with this Block.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter canCollide | Type boolean | Description Can entities collide with this Block. |
Sets the harvest level for this Block.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter level | Type int | Description the new harvest level. |
Sets the harvest tool for this Block.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter type | Type ToolType? | Description The new tooltype. |
Sets the jump factor of this Block.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter jumpFactor | Type float | Description The new jump factor of this Block. |
Sets the material of this Block.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter material | Type MCMaterial | Description The new material of this Block. |
Sets the slipperiness of this Block.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter slipperiness | Type float | Description The new slipperiness of this Block. |
Sets the speed factor of this Block.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter speedFactor | Type float | Description The new speed factor of this Block. |
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name blastResistance | Type float | Has Getter true | Has Setter true | Description Gets the blast resistance of this Block. |
Name canCollide | Type boolean | Has Getter true | Has Setter true | Description Checks if entities can collide with this Block. |
Name commandString | Type string | Has Getter true | Has Setter false | Description Gets the block bracket handler syntax for this Block. E.G. |
Name defaultState | Type MCBlockState | Has Getter true | Has Setter false | Description Gets the default MCBlockState of this Block. |
Name harvestLevel | Type int | Has Getter true | Has Setter true | Description Gets the harvest level for this Block. NOTE: This will get the level for the default blockstate, you should use the BlockState specific method for a more accurate result! |
Name harvestTool | Type ToolType? | Has Getter true | Has Setter true | Description Gets the harvest tool for this Block. NOTE: This will get the tool for the default blockstate, you should use the BlockState specific method for a more accurate result! |
Name jumpFactor | Type float | Has Getter true | Has Setter true | Description Gets the jump factor of this Block. |
Name lootTable | Type string | Has Getter true | Has Setter false | Description Gets the loot table id for this Block. |
Name material | Type MCMaterial | Has Getter true | Has Setter true | Description Gets the material of this Block. |
Name registryName | Type MCResourceLocation | Has Getter true | Has Setter false | Description Gets the registry name of this block. |
Name slipperiness | Type float | Has Getter true | Has Setter true | Description Gets the slipperiness of this Block. |
Name speedFactor | Type float | Has Getter true | Has Setter true | Description Gets the speed factor of this Block. |
Name tags | Type stdlib.List<MCTag<MCBlock>> | Has Getter true | Has Setter false | Description Gets all the MCTag<T>s that contain this Block. |
Name translationKey | Type string | Has Getter true | Has Setter false | Description Gets the translation key that is used to localize this Block. |
Name validStates | Type stdlib.List<MCBlockState> | Has Getter true | Has Setter false | Description Gets a list of valid MCBlockStates for this Block. |
Name variableOpacity | Type boolean | Has Getter true | Has Setter false | Description Checks if the opacity of this block is different in different areas of the Block. |