minecraft library Null safety

Classes

BlockedServer
Represents a blocked server that the player shouldn't be allowed to join.
Minecraft
Includes all Minecraft and Minecraft Launcher specific functionality.
MinecraftNews
A Minecraft News item.
MinecraftPatch
A Patch/Version of Minecraft, including a image and a description.
MinecraftStatistics
Stores Minecraft Sale Statistics.
Mojang
Mojang API specific functionality. [...]
MojangStatus
Contains the MojangSiteStatus of all Minecraft and Mojang sites.
Name
A Name helper class used for Mojang.getNameHistory(). It contains the name and the date it was changed to.
NbtArray<T>
The base of any array or list nbt tag. Uses the ListMixin to inherit all methods and properties of a List.
NbtByte
Represents a single byte in a NBT file.
NbtByteArray
Represents a array of single byte integers in a NBT file.
NbtCompound<T extends NbtTag>
Represents a list of named NbtTags. Unlike NbtList, this can have any type of NbtTag in its list.
NbtDouble
Represents a 8 byte double precision floating point number in a NBT file.
NbtFile
Represents a NBT file.
NbtFloat
Represents a 4 byte single precision floating point number in a NBT file.
NbtInt
Represents a 4 byte integer in a NBT file.
NbtIntArray
Represents a array of 4 byte integers in a NBT file.
NbtList<T extends NbtTag>
Represents a list of unnamed NbtTags. Can only be a single type of NbtTag, e.g. only a list of NbtInt.
NbtLong
Represents a 8 byte long integer in a NBT file.
NbtLongArray
Represents a array of 8 byte long integers in a NBT file.
NbtShort
Represents a 2 byte short integer in a NBT file.
NbtString
Represents a String inside a NBT File.
NbtTag
Represents the base of any NBT Tag.
PacketReader
Reads different server packets from binary into objects.
PacketWriter
Writes various different server packets into binary.
Pair<A, B>
Creates a pair of values.
Profile
A Minecraft user including their skin/cape.
ProfileTextures
Represents all textures for a minecraft profile.
ServerPacket
The basis of each and every packet for post 1.6 servers.
Version
A Minecraft Version.
VersionManifest
A manifest of all currently available Minecraft Versions. Also has latest release and snapshot versions.
Yggdrasil

Extensions

MinecraftStatisticsItemExt
Extension on MinecraftStatisticsItem to give each enum value a string value.
NbtTagFunctions
Extension on NbtTagType to give each enum value some functions.

Functions

authenticate(String username, String password, {String? clientToken}) Future<MojangAccount>
Authenticates a user with given credentials username and password. [...]
changeName(String uuid, String newName, String accessToken, String password) Future<bool>
Changes the Mojang account name to newName.
changePassword(String currentPassword, String newPassword, String accessToken) Future<bool>
Changes the currentPassword to the new newPassword. This requires a valid accessToken and will throw a ArgumentError if it is not. Be careful to what values you pass into newPassword, as the accessToken will get invalidated and you will need it to log into your account again.
changeSkin(Uri skinUrl, String accessToken, [SkinModel skinModel = SkinModel.classic]) Future<bool>
Change the skin with the texture of the skin at skinUrl.
getBlockedServers() Future<List<BlockedServer>>
Returns a list of blocked servers.
getLibraryUrl(String package, String name, String version, {String? os}) String
Get the URL for a maven library. The os string should be null or "linux", "windows" or "osx".
getName(String uuid) Future<PlayerUuid>
Get the name and UUID by a player's UUID. [...]
getNameHistory(String uuid) Future<List<Name>>
Returns the name history for the account with uuid.
getNews() Future<List<MinecraftNews>>
Returns a List of the most recent news for Minecraft. [...]
getPatchNotes() Future<List<MinecraftPatch>>
Returns a List of the most recent patch notes for Minecraft: Java Edition. [...]
getProfile(String uuid) Future<Profile>
Returns the user profile including skin/cape information. [...]
getResourceUrl(String hash) String
Get the resource URL for a given hash.
getStatistics(List<MinecraftStatisticsItem> items) Future<MinecraftStatistics>
Get's Minecraft: Java Edition, Minecraft Dungeons, Cobalt and Scrolls purchase statistics. [...]
getStatus() Future<MojangStatus>
Returns the Mojang and Minecraft API and website status
getUuid(String username, {DateTime? timestamp}) Future<PlayerUuid>
Returns the UUID for player username. [...]
getUuids(List<String> usernames) Future<List<PlayerUuid>>
Returns a List of player UUIDs by a List of player names. [...]
getVersions() Future<VersionManifest>
Returns a Manifest with all Minecraft: Java Edition Versions, including alpha/beta and snapshot versions.
invalidate(MojangAccount mojangAccount) Future<bool>
Invalidates the accessToken of given mojangAccount.
isNameAvailable(String name, String accessToken) Future<bool>
Checks whether or not given name is available or not. A name must be at least 3 characters and at most 16 characters long and not include any invalid characters to be valid. If your access token is invalid, this will silently fail and return false.
isNameAvailableNoAuth(String name) Future<bool>
Essentially the same as isNameAvailable, however this function does not require any authentication. It is not exactly accurate, however can be used to determine if a name was blocked by Mojang's name filter and/or the name is used on a empty Mojang account. [...]
ping(String serverUri, {int port = 25565, Duration timeout = const Duration(seconds: 30)}) Future<ResponsePacket?>
Ping a single server. port will default to 25565 as that is the default Minecraft server port. This method is for post 1.6 servers.
pingUri(String serverUri) Future<ResponsePacket?>
refresh(MojangAccount account) Future<MojangAccount>
Refreshes the account. The account data will be overridden with the new refreshed data. The return value is also the same account object.
reserveName(String newName, String accessToken) Future<bool>
Reserves the newName for this Mojang Account.
resetSkin(String uuid, String accessToken) Future<void>
Reset's the player's skin.
signout(String username, String password) Future<bool>
Signs the user out and invalidates the accessToken.
validate(String accessToken, {String? clientToken}) Future<bool>
Checks if given accessToken and clientToken are still valid. [...]

Enums

MinecraftPatchType
MinecraftStatisticsItem
Statistics items that can be selected.
MojangSiteStatus
The status of a site. [...]
NbtCompression
The compression of a NbtFile. Implementation of detecting the compression can be found at NbtFileReader#detectCompression.
NbtTagType
Different tags for each Nbt Tag that exists.
PacketCompression
SkinModel
The skin model of a texture

Typedefs

PlayerUuid = Pair<String, String>

Exceptions / Errors

AuthException
Thrown when invalid credentials are passed to any authentication service.
NbtFileReadException
NbtFileWriteException
PingException
TooManyRequestsException
Thrown when the rate limit for a endpoint has been exceeded.