Interface MapFrame


public interface MapFrame
An item frame holding a map that exists only for one player.

The frame is not part of the world: other players do not see it, nothing can break it and it is never saved. While it hangs, the map is sent to its viewer as if shown to them. Hang one with MapView.hang(Player, BlockPosition, BlockFace, boolean).

A frame comes down when it is removed, when its map is deleted, and when its viewer leaves or goes to another world, since their client forgets it then. The client also forgets it when its chunk leaves the view distance of the viewer, so hang frames near them.

Since:
0.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the block the frame takes up.
    Returns the direction the front of the frame faces; it hangs on the opposite side of its block.
    boolean
    Returns whether the frame itself is invisible, leaving only the map.
    boolean
    Returns whether the frame came down.
    map()
    Returns the map in the frame.
    void
    Takes the frame down.
    Returns the player who sees the frame; only valid while they stay connected.
    Returns the world the frame hangs in, the world of the viewer when it was hung.
  • Method Details

    • map

      MapView map()
      Returns the map in the frame.
      Returns:
      the map in the frame
      Since:
      0.1.0
    • viewer

      Player viewer()
      Returns the player who sees the frame; only valid while they stay connected.
      Returns:
      the player who sees the frame; only valid while they stay connected
      Since:
      0.1.0
    • world

      Key world()
      Returns the world the frame hangs in, the world of the viewer when it was hung.
      Returns:
      the world the frame hangs in, the world of the viewer when it was hung
      Since:
      0.1.0
    • block

      BlockPosition block()
      Returns the block the frame takes up.
      Returns:
      the block the frame takes up
      Since:
      0.1.0
    • facing

      BlockFace facing()
      Returns the direction the front of the frame faces; it hangs on the opposite side of its block.
      Returns:
      the direction the front of the frame faces; it hangs on the opposite side of its block
      Since:
      0.1.0
    • invisible

      boolean invisible()
      Returns whether the frame itself is invisible, leaving only the map.
      Returns:
      whether the frame itself is invisible, leaving only the map
      Since:
      0.1.0
    • isRemoved

      boolean isRemoved()
      Returns whether the frame came down.
      Returns:
      whether the frame came down
      Since:
      0.1.0
    • remove

      void remove()
      Takes the frame down. Does nothing when it already came down.
      Since:
      0.1.0