Modding Help [Solved] Get tile information from placed blocks?

Discussion in 'Starbound Modding' started by TinoD, Feb 14, 2017.

  1. TinoD

    TinoD Void-Bound Voyager

    Is there a way to get information from placed tiles?
    I am thinking something along the lines of a function like world.getTileAt(xpos, ypos) which would return the type of block that is placed at the specified position.
    If this is not possible from the Lua API, how else can I get the information except for editing .world files?

    Thanks in advance for any help.
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    #### `Variant<String, bool>` world.material(`Vec2F` position, `String` layerName)

    Returns the name of the material at the specified position and layer. Layer can be specified as 'foreground' or 'background'. Returns `false` if the space is empty in that layer. Returns `nil` if the material is NullMaterial (e.g. if the position is in an unloaded sector).
    bk3k, TinoD and IHart like this.
  3. TinoD

    TinoD Void-Bound Voyager

    Love it! Thank you very much!

Share This Page