Package org.bukkit.map

# Class MapCursor

java.lang.Object
org.bukkit.map.MapCursor

public final class MapCursor extends Object
Represents a cursor on a map.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`MapCursor.Type`
Represents the standard types of map cursors.

## Constructor Summary

Constructors
Constructor
Description
`MapCursor(byte x, byte y, byte direction, byte type, boolean visible)`
Deprecated.
Magic value
`MapCursor(byte x, byte y, byte direction, byte type, boolean visible, @Nullable String caption)`
Deprecated.
Magic value.
`MapCursor(byte x, byte y, byte direction, byte type, boolean visible, Component caption)`
Deprecated.
Magic value
`MapCursor(byte x, byte y, byte direction, @NotNull MapCursor.Type type, boolean visible)`
Initialize the map cursor.
`MapCursor(byte x, byte y, byte direction, @NotNull MapCursor.Type type, boolean visible, @Nullable String caption)`
Initialize the map cursor.
`MapCursor(byte x, byte y, byte direction, @NotNull MapCursor.Type type, boolean visible, Component caption)`
Initialize the map cursor.

## Method Summary

Modifier and Type
Method
Description
`Component`
`caption()`
Gets the caption on this cursor.
`void`
`caption(Component caption)`
Sets the caption on this cursor.
`@Nullable String`
`getCaption()`
Deprecated.
in favour of `caption()`
`byte`
`getDirection()`
Get the direction of this cursor.
`byte`
`getRawType()`
Deprecated.
Magic value
`@NotNull MapCursor.Type`
`getType()`
Get the type of this cursor.
`byte`
`getX()`
Get the X position of this cursor.
`byte`
`getY()`
Get the Y position of this cursor.
`boolean`
`isVisible()`
Get the visibility status of this cursor.
`void`
`setCaption(@Nullable String caption)`
Deprecated.
in favour of `caption(net.kyori.adventure.text.Component)`
`void`
`setDirection(byte direction)`
Set the direction of this cursor.
`void`
`setRawType(byte type)`
Deprecated.
Magic value
`void`
`setType(@NotNull MapCursor.Type type)`
Set the type of this cursor.
`void`
`setVisible(boolean visible)`
Set the visibility status of this cursor.
`void`
`setX(byte x)`
Set the X position of this cursor.
`void`
`setY(byte y)`
Set the Y position of this cursor.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MapCursor

@Deprecated public MapCursor(byte x, byte y, byte direction, byte type, boolean visible)
Deprecated.
Magic value
Initialize the map cursor.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
  `visible` - Whether the cursor is visible by default.

### MapCursor

public MapCursor(byte x, byte y, byte direction, @NotNull @NotNull MapCursor.Type type, boolean visible)
Initialize the map cursor.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
  `visible` - Whether the cursor is visible by default.

### MapCursor

@Deprecated public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, @Nullable @Nullable String caption)
Deprecated.
Magic value. Use `MapCursor(byte, byte, byte, byte, boolean, net.kyori.adventure.text.Component)`
Initialize the map cursor.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
  `visible` - Whether the cursor is visible by default.
  `caption` - cursor caption

### MapCursor

@Deprecated public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, @Nullable Component caption)
Deprecated.
Magic value
Initialize the map cursor.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
  `visible` - Whether the cursor is visible by default.
  `caption` - cursor caption

### MapCursor

public MapCursor(byte x, byte y, byte direction, @NotNull @NotNull MapCursor.Type type, boolean visible, @Nullable Component caption)
Initialize the map cursor.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
  `visible` - Whether the cursor is visible by default.
  `caption` - cursor caption

### MapCursor

public MapCursor(byte x, byte y, byte direction, @NotNull @NotNull MapCursor.Type type, boolean visible, @Nullable @Nullable String caption)
Initialize the map cursor.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
  `visible` - Whether the cursor is visible by default.
  `caption` - cursor caption

## Method Details

### getX

public byte getX()
Get the X position of this cursor.

Returns:
  The X coordinate.

### getY

public byte getY()
Get the Y position of this cursor.

Returns:
  The Y coordinate.

### getDirection

public byte getDirection()
Get the direction of this cursor.

Returns:
  The facing of the cursor, from 0 to 15.

### getType

@NotNull public @NotNull MapCursor.Type getType()
Get the type of this cursor.

Returns:
  The type (color/style) of the map cursor.

### getRawType

@Deprecated public byte getRawType()
Deprecated.
Magic value
Get the type of this cursor.

Returns:
  The type (color/style) of the map cursor.

### isVisible

public boolean isVisible()
Get the visibility status of this cursor.

Returns:
  True if visible, false otherwise.

### setX

public void setX(byte x)
Set the X position of this cursor.

Parameters:
  `x` - The X coordinate.

### setY

public void setY(byte y)
Set the Y position of this cursor.

Parameters:
  `y` - The Y coordinate.

### setDirection

public void setDirection(byte direction)
Set the direction of this cursor.

Parameters:
  `direction` - The facing of the cursor, from 0 to 15.

### setType

public void setType(@NotNull @NotNull MapCursor.Type type)
Set the type of this cursor.

Parameters:
  `type` - The type (color/style) of the map cursor.

### setRawType

@Deprecated public void setRawType(byte type)
Deprecated.
Magic value
Set the type of this cursor.

Parameters:
  `type` - The type (color/style) of the map cursor.

### setVisible

public void setVisible(boolean visible)
Set the visibility status of this cursor.

Parameters:
  `visible` - True if visible.

### caption

@Nullable public Component caption()
Gets the caption on this cursor.

Returns:
  caption

### caption

public void caption(@Nullable Component caption)
Sets the caption on this cursor.

Parameters:
  `caption` - new caption

### getCaption

@Nullable @Deprecated public @Nullable String getCaption()
Deprecated.
in favour of `caption()`
Gets the caption on this cursor.

Returns:
  caption

### setCaption

@Deprecated public void setCaption(@Nullable @Nullable String caption)
Deprecated.
in favour of `caption(net.kyori.adventure.text.Component)`
Sets the caption on this cursor.

Parameters:
  `caption` - new caption