Minecraft Wiki

除另有声明,转载时均必须注明出处若簡繁轉換出錯,請以遊戲內為準请勇于扩充与修正内容有兴趣逛逛我们的微博沟通交流,欢迎到社区专页需要协助,请在告示板留言

了解更多

Minecraft Wiki
Advertisement
[编辑 | 历史 | 清除缓存]文档页面
Lua logo.svg

此模板使用了模块:Materials row,此脚本使用Lua编写。
更多详情,请参阅维基百科:LuaMediaWiki:扩展:Scribunto

该模板用于创建材料属性表,以展示各个材料的特征。

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. 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.

  • {{{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.
Advertisement