Player API 1.7.10/1.7.2/1.6.4 for Minecraft

Player API is an API which provides access to the client class “EntityPlayerSP” aka “bag” or the server class “EntityPlayerMP” aka “iq” or the bukkit class “EntityPlayer” while minimizing conflicts between mods. Player API gives third party mods managed access to the main player class. To make a player API simply make a class that extends PlayerBase (much like extending BaseMod) and register it with PlayerAPI.RegisterPlayerBase(PlayerBaseExample.class); in your mod_ file constructor. An example PlayerBaseMoods is included in the download. To get a PlayerBase from the player you can use the method PlayerAPI.getPlayerBase(player, PlayerBaseExample.class).

Player API needed in the installation of many other mods like Single Player Commands Mod, Smart Moving Mod, SkyrimCraft Mod, and Flans Mods. You can install this mod at client, server and bukkit. Player API is compatible with Minecraft Forge, just install Player API after Minecraft Forge.

Player API

Player API Installation

Client Installation

  1. Download the Player API
  2. Go to the appdata folder and navigate to .minecraft/bin
  3. Open minecraft.jar in WinZIP, WinRAR or 7zip
  4. Drag the three class files from Player API into the jar
  5. Delete the META-INF folder if you haven’t already

Server Installation

  1. Download the Player API
  2. Open minecraft_server.jar in WinZIP, WinRAR or 7zip
  3. Drag the three class files from Player API into the jar

Player API Download Link

For MC 1.7.10 : Player API 1.7.10

For MC 1.7.2 : Player API 1.7.2

For MC 1.6.4 (Vanilla) : http://www.mediafire.com/?e4nlnz8bt07bq51 – [Alternate]
Forge : http://www.mediafire.com/?1r3qtfte5wv3rb6 – [Alternate]

For MC 1.6.2 : http://www.mediafire.com/?p5dpc5s8ifzi9ky – [Alternate]

For MC 1.6.1 : http://www.mediafire.com/?b83yyb6tfr4q18x – [Alternate]

For MC 1.5.2 : http://www.mediafire.com/?ttolbzy7h50oui6 – [Alternate]
For MC 1.5.1 : http://www.mediafire.com/?nbqnfw11z48igfc – [Alternate]
For MC 1.5 : http://www.mediafire.com/?q4d2u38d8588q51
For MC 1.4.7: Download for 1.4.7
For MC 1.4.6: Download for 1.4.6
For MC 1.4.5: Download for 1.4.5

Step by Step Mod Adaption

One scenario of starting to develop with this mod is that you have a fully functional mod that overwrites the client/server main player class, and you want your mod to be compatible with other mods that are allready using Player API.

  • In this case the following steps are recommended:
    Outsource your mod specific code from EntityPlayerSP.java/EntityPlayerMP.java into a new mod specific class you create a single instance for each instance of the EntityPlayer class so that only the mod class field, some hook methods and some field accessors remain in EntityPlayerSP.java/EntityPlayerMP.java.
  • make sure your mod works correctly.
  • Embedd Player API into your development environment (in case of MCP that means to decompile the Player API classes using the MCP decompiling system)
  • In case of MCP replace your modded EntityPlayerSP.java with the EntityPlayerSP.java from Player API client. (and import all other Player API client classes)
    - Let your specific mod class extend the PlayerBase class
    - Make sure your mod class is registered at the PlayerAPI class before the first player instance is created. (a ModLoader mod would be a good choice here)
    - Adapt all your hook listeners in your mod class to overwrite their corresponding PlayerBase methods.
    - Adapt all your field accessor references with references to PlayerAPI field accessors.
  • Check whether required hooks are missing and send me a private message containing the the corresponding EntityPlayerSP/EntityPlayerMP method names (and wait until I updated Player API) if necessary.
  • Make sure your mod works correctly.

Step by Step Mod Creation

Another scenario is that you want to develop a new mod with Player API.

  • In this case the following steps are recommended:
    Embedd Player API into your development environment (in case of MCP that means to decompile the Player API classes using the MCP decompiling system)
  • Start creating a new class that extends your Player API’s PlayerBase class.
  • Make sure your mod’s PlayerBase class is registered at the PlayerAPI class before the first player instance is created. (a ModLoader mod would be a good choice here)
  • Overwrite the PlayerBase methods you need to make your mod work.

Credits to Divisor for makes and updates this awesome Player API.

Comments

Tags: , , , , , , , , , , , , , , , , , , , ,

Category: Minecraft Mods