Minecraft Wiki
Advertisement
Minecraft Wiki
[edit | history | purge]Documentation
Lua logo.png
This template uses Module:Materials row, a script written in Lua.
Please see wp:Lua and mw:Extension:Scribunto to learn more.

This template is used to create the rows for the table containing the material properties on Materials.

Περιεχόμενα

Usage

The parameter is set to the title to display in the first column.

The parameter {{{rgb}}} contains three color values separated by commas to display as a colored cell and text. It should be set based on the material's map color. If unset, it defaults to a white color and the text "None"

Properties

The table contains the following properties. They are set to 1 for true, and 0 for false.

Name Subclass only? Description Default
{{{liquid}}} Yes The block allows the player to swim. 0
{{{solid}}} Yes This block allows block dependent blocks to be placed on it, and is considered when spawning various structures. 1
{{{blocklight}}} Yes This block reduces the level of light passing through it (often blocking it entirely). 1
{{{blockmove}}} Yes This block prevents movement through it, and usually suffocates entities inside of it. 1
{{{opaque}}} No This block cannot be seen through. {{{blockmove}}}
{{{tool}}} No This block requires a tool to give a drop. 0
{{{burn}}} No This block can become lit from lava. 0
{{{replace}}} No This block will be replaced from using another block on it. 0
{{{adventureExempt}}} No Does not seem to be used anywhere in Minecraft, and is not displayed in the table. The name comes from MCP. 0

Subclasses can also be set using {{{subclass}}} for to change the defaults based on coded subclasses. Values include:

  • liquid
    • defaults {{{liquid}}} and {{{replace}}} to 1
    • defaults {{{blockmove}}} and {{{solid}}} to 0
    • defaults {{{piston}}} to "replace"
  • nonsolid
    • defaults {{{adventureExempt}}} to 1
    • defaults {{{solid}}}, {{{blocklight}}} and {{{blockmove}}} to 0
  • portal
    • defaults {{{solid}}}, {{{blocklight}}} and {{{blockmove}}} to 0
  • liquid
    • defaults {{{replace}}} to 1
    • defaults {{{solid}}}, {{{blocklight}}} and {{{blockmove}}} to 0
  • cobweb
    • defaults {{{blockmove}}} to 1

The parameter {{{piston}}} can be set to determine the interaction when a piston pushes the block. Options are as follows:

  • pushed - pushes the block, default
  • replace - breaks the block being pushed
  • blocked - stops the piston from extending

Code

The parameters generally correspond to the actual structure of the code. With reference to MCP 9.10:

  • {{{subclass}}} refers to actual subclasses of the Material class. Names mostly match, but "nonsolid" is MaterialLogic, while "cobweb" is the inline class used for the web material.
  • {{{liquid}}} refers to the isLiquid() method.
  • {{{solid}}} refers to the isSolid() method.
  • {{{blocklight}}} refers to the blocksLight() method.
  • {{{blockmove}}} refers to the blocksMovement() method.
  • {{{opaque}}} refers to the setTranslucent() and isOpaque() methods.
  • {{{tool}}} refers to the setRequiresTool() and isToolNotRequired() methods.
  • {{{burn}}} refers to the setBurning() and getCanBurn() methods.
  • {{{replace}}} refers to the setReplaceable() and isReplaceable() methods.
  • {{{adventureExempt}}} refers to the setAdventureModeExempt() method.
  • {{{piston}}} refers to the setNoPushMobility(), setImmovableMobility(), and getMaterialMobility() methods.

See also

  • {{[[::Materials/blocks row|
Materials/blocks row]]}}
Advertisement