Home
Identity is a useful Minecraft plug-in for creating Identity with last name, first name, gender, and age. We will learn a few fundamentals in order to begin customizing our experience as much as possible.
To begin, let's look at how to use colours. They are entirely based on MiniMessage, so I recommend reading the MiniMessage wiki on how to use them. There is also included a link below that will allow you to test the different colour formats without having to reload the plug-in (here).
Identity's inventories are all structured in a fully configurable and easy-to-understand manner.
{SLOT}:
action: {ACTION}
material: {MATERIAL}
custom-model-data: {CUSTOM_MODEL_DATA}
texture: {HEAD_TEXTURE}
name: {DISPLAYNAME}
lore:
- "lore line..."
- "lore line..."
- ...
The actions that occur when you click serve to interact with the setup, are predefined and can be utilized in inventories relating to them:
- ADD_AGE (+1 to the value of age)
- REMOVE_AGE (-1 to the value of age)
- CONFIRM_AGE (Confirms the selected age)
- ENTER_NAME (Starts the name setup process)
- FEMALE (Selects female gender)
- MALE (Selects male gender)
- NONBINARY (Selects nonbinary gender)
- NONE
If the material is CUSTOM_HEAD, then a texture value for a custom head is required. To get these, go to https://minecraft-heads.com/custom-heads and, once there, click on the head that you desire, scroll down to the "Minecraft URL" field and enter that value into the config.
0:
action: ADD_AGE
material: "CUSTOM_HEAD"
custom-model-data: 10030
texture: "b056bc1244fcff99344f12aba42ac23fee6ef6e3351d27d273c1572531f"
name: "<green><bold>Click to add <gray>(+1)"
lore:
- "<gray>Click to add a year"
Post-commands and Gender-Commands are commands that are executed at the end of the setup process; gender commands are initiated based on the gender that was selected.
post-process:
commands:
{YOUR_COMMAND_NAME}:
executor: {EXECUTOR} #PLAYER, CONSOLE
command: "{YOUR_COMMAND}" #You can use the placeholders **{X} {Y} {Z}** for the player's coordinates and **{PLAYER}** for the player's name.
post-process:
commands:
heal-command:
executor: CONSOLE
command: "/heal {PLAYER}"
post-process:
gender-commands:
{GENDER_NAME}: #Gender name can be male, female & non-binary.
executor: {EXECUTOR} #PLAYER, CONSOLE
command: "{YOUR_COMMAND}" #You can use the placeholders **{X} {Y} {Z}** for the player's coordinates and **{PLAYER}** for the player's name.
post-process:
gender-commands:
non-binary:
executor: CONSOLE
command: "/heal {PLAYER}"
A frequently asked question is how I set a specific item in the GUI for each age during setup. So here's an example, along with the format:
inventories:
age:
data:
per-age-item:
{AGE}:
custom-model-data: {CUSTOM_MODEL_DATA}
material: {MATERIAL}
name: {DISPLAYNAME}
lore:
- "lore line..."
- "lore line..."
- ...
inventories:
age:
data:
per-age-item:
25:
custom-model-data: 10038
material: PAPER
name: "<green>Click to confirm (%actualage%)"
lore:
- "<gray>This is your age, click to confirm."
#API The ability to use an API is one of the most useful features of this plug-in. Add Identity.jar to your project as a library and you're ready to go.
/**
* If the player's data exists, return a new Person object with the player's name, gender, and age.
*
* @param uuid The UUID of the player you want to get the identity of.
* @return A Person object.
*/
public Person getUserIdentity(UUID uuid);
/**
* If the player's data exists, return a new Person object with the player's name, gender, and age.
*
* @param playerName The name of the player you want to get the identity of.
* @return A Person object.
*/
public Person getUserIdentity(String playerName); **(Deprecated)**
@Override
public void onEnable() {
Identity identity = (Identity) Bukkit.getPluginManager().getPlugin("Identity");
Person person = identity.getAPI().getUserIdentity("Drago903");
System.out.println(
"Name: " + person.getName()
+ " Gender: " + person.getGender()
+ " Age: " + person.getAge());
}
}