Types
The Minecraft types blocks pass around, where to get one and what to do with it.
Block
Represents a block. This is a live object, and only one Block may exist for any given location in a world. The state of the block may change concurrently to your own handling of it; use block.getState() to get a snapshot state of a block which will not be modified. Note that parts of this class which require access to the world at large (i.e. lighting and power) may not be able to be safely accessed during world generation when used in cases like BlockPhysicsEvent!!!!
Where to get one:
event.clickedBlockinwhen a player interactsevent.bedinwhen a player enters a bedevent.blockinwhen a block is brokenevent.blockinwhen a block is placedevent.blockAgainstinwhen a block is placedblock at [Location]
What you can do with it:
Component
A Component is an immutable object that represents how text is displayed Minecraft clients. Components can be thought of as the combination of: The message the Component wants to display; and The Style of that message. The most basic component is the TextComponent, where the message is a simple String. However, other dynamic Components are available, which are linked to from here and you are encouraged to explore to better support your plugin/mod. Factories and builders for all available component types are provided via this interface. Components can be serialized to and deserialized from other formats via the use of serializers. If used within one of our natively supported platforms, the availability of such serializers may vary, consult the documentation or support for the given platform should this be the case. Further information about Components, along with functional examples of how they can be used, can be found on our documentation.
Where to get one:
event.joinMessageinwhen a player joinsevent.quitMessageinwhen a player leavesevent.messageinwhen a player chatsevent.deathMessageinwhen a player dies
What you can do with it:
List
No description yet.
Where to get one:
What you can do with it:
for each [variable] in [list]add [any value] to [list]insert [any value] at [number] in [list]item [number] of [list]set item [number] of [list] to [any value]remove item [number] of [list]remove [any value] from [list]length of [list][list] contains [any value]position of [any value] in [list]clear [list]
Location
class
Represents a 3-dimensional position in a world. No constraints are placed on any angular values other than that they be specified in degrees. This means that negative angles or angles of greater magnitude than 360 are valid, but may be normalized to any other equivalent representation by the implementation.
Where to get one:
event.frominwhen a player movesevent.toinwhen a player movesevent.frominwhen a player teleportsevent.toinwhen a player teleportsevent.respawnLocationinwhen a player respawnslocation of [Player][Location] offset by x:[number] y:[number] z:[number]location of [Block]Create Location in [World] x:[number] y:[number] z:[number]
What you can do with it:
[Location] offset by x:[number] y:[number] z:[number]distance from [Location] to [Location]x of [Location]y of [Location]z of [Location]block at [Location]teleport [Player] to [Location]play sound [Sound] to [Player] at [Location] · volume [number] · pitch [number]play sound [Sound] to [Player] at [Location] in category [SoundCategory] · volume [number] · pitch [number]in [World] spawn [EntityType] at [Location]in [World] show [Particle] particles at [Location] · count [number]in [World] strike lightning at [Location]
Map
No description yet.
What you can do with it:
Player
interface · also counts as HumanEntity, Damageable, Entity, CommandSender, Permissible, OfflinePlayer
Represents a player, connected or not
Where to get one:
event.playerinwhen the command /[text] is runevent.playerinwhen a player joinsevent.playerinwhen a player leavesevent.playerinwhen a player chatsevent.playerinwhen a player runs a commandevent.playerinwhen a player movesevent.playerinwhen a player teleportsevent.playerinwhen a player changes worldevent.playerinwhen a player diesevent.playerinwhen a player respawnsevent.playerinwhen a player interactsevent.playerinwhen a player eats or drinksevent.playerinwhen a player enters a bedevent.playerinwhen a player starts or stops sneakingevent.playerinwhen a player starts or stops sprintingevent.playerinwhen a player's level changesevent.playerinwhen a player gains experienceevent.playerinwhen a player's game mode changesevent.playerinwhen a block is brokenevent.playerinwhen a block is placed
What you can do with it:
[Player] has played beforename of [Player]location of [Player]world of [Player]health of [Player]food level of [Player][Player] is sneakinggame mode of [Player][Player] has permission [text]send [Player] the message [text]teleport [Player] to [Location]set health of [Player] to [number]set food level of [Player] to [number]set [Player] on fire for [number] ticksgive [Player] [number] experiencekick [Player] with reason [text]play sound [Sound] to [Player] at [Location] · volume [number] · pitch [number]set game mode of [Player] to [GameMode]play sound [Sound] to [Player] at [Location] in category [SoundCategory] · volume [number] · pitch [number]give [Player] [number] of item [Material]give [Player] effect [PotionEffectType] for [number] ticks at level [number]set attribute [Attribute] of [Player] to [number]enchant [Player]'s held item with [Enchantment] level [number]equip [Player]'s [EquipmentSlot] with [Material]send [Player] a [NamedTextColor] message [text]scoreboard of [Player]
Player>
class
No description yet.
Where to get one:
ScoreboardState
class
No description yet.
Where to get one:
What you can do with it:
World
interface · also counts as RegionAccessor
Represents a world, which may contain entities, chunks and blocks
Where to get one:
event.worldinwhen the server startsevent.frominwhen a player changes worldworld of [Player]world of [Block]
What you can do with it: