PotatoMaster101.Mojapi 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package PotatoMaster101.Mojapi --version 1.0.4                
NuGet\Install-Package PotatoMaster101.Mojapi -Version 1.0.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PotatoMaster101.Mojapi" Version="1.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PotatoMaster101.Mojapi --version 1.0.4                
#r "nuget: PotatoMaster101.Mojapi, 1.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PotatoMaster101.Mojapi as a Cake Addin
#addin nuget:?package=PotatoMaster101.Mojapi&version=1.0.4

// Install PotatoMaster101.Mojapi as a Cake Tool
#tool nuget:?package=PotatoMaster101.Mojapi&version=1.0.4                

Mojang API

An asynchronous Mojang API wrapper in C# targeting .NET 5 and above.

Quick Start

I want to authenticate!

var auth = await new AuthenticationEndpoint(new Credentials("username", "password")).Request();
Console.WriteLine(auth.Token.AccessToken);
Console.WriteLine(auth.Token.ClientToken);

Who the hell is this guy? Give me his past names!

var player = await new SingleUuidEndpoint("player").Request();
var history = await new NameHistoryEndpoint(player.Player.Uuid).Request();

foreach (var (name, timestamp) in history.History)
    Console.WriteLine($"{name}, {timestamp}");

Give me this guy's skin! I like it!

var player = await new SingleUuidEndpoint("player").Request();
var profile = await new ProfileEndpoint(player.Player.Uuid).Request();
Console.WriteLine(profile.Texture.SkinUrl);

Let me change my skin!

Change skin to a local file:

var skin = new Skin("some/minecraft/skin.png", Skin.SlimStyle);     // or Skin.ClassicStyle
var upload = await new UploadSkinEndpoint("access token", skin).Request();
Console.WriteLine(upload.ChangedSkin.Url);

Change skin to a network image:

var skin = new Skin("https://some/online/skin.png", Skin.SlimStyle);    // or Skin.ClassicStyle
var upload = await new ChangeSkinEndpoint("access token", skin).Request();
Console.WriteLine(upload.ChangedSkin.Url);

More examples!

See more examples on the GitHub repo.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.6 575 6/26/2021 1.0.6 is deprecated because it is no longer maintained.
1.0.5 408 6/26/2021
1.0.4 331 6/23/2021
1.0.3 361 6/22/2021
1.0.2 317 6/22/2021
1.0.1 488 6/21/2021
1.0.0 528 6/21/2021

Fix some inconsistent code documentation