Identity

Identity is a mod that allows for transformations similar to Morph. Each transformation may likely have abilities. Config options are available for kill requirements, flight, content creator related settings and more.

GitHub Wiki

Video Review

Curseforge Description/Images:
Identity is a mod inspired by Morph, originally built for the Fabric mod loader, and now available on Forge through Architectury. To view information on configuring Identity & interacting with its API, visit the wiki page!

This project requires Architectury API on Fabric & Forge.

With Identity, you can become anything you want: friend or foe, hot or cold, fluffy or rough.















Getting Started

To unlock an Identity, kill a nearby mob. You'll see a notification above your hotbar informing you of the unlock. You can then press the ` key to swap between identities. Once you have equipped an Identity, you can use its ability by pressing "R". To look at available abilities, check out the wiki page here.

License

Identity is licensed under MIT.

Abilities
Several mobs in Identity have special abilities that can be used by pressing the "R" key. These abilities have effects that range from utility to damage and have varying cooldowns depending on their potency.

To modify ability cooldowns, visit the abilityCooldownMap config option. Entity IDs can be mapped to integers representing their ability cooldown in ticks.

Ghast

Cooldown: 5s

Shoots a Fire Charge in your facing direction that goes boom on impact. Perfect for annoying your friends running across bridges in The Nether.

Creeper

Cooldown: 10s

Summons an explosion around yourself... don't worry, it doesn't kill you, and blocks won't break. Just don't use it around pets.

Blaze

Cooldown: 1s

Shoots a baby fireball in the direction you are looking at. Cook those Cows with style!

Enderman

Cooldown: 10s

What did you think it would do? Click to teleport in the direction you're looking at.

Snow Golem

Cooldown: 0.5s

Shoot a barrage of snowballs at your enemy!

Wither

Cooldown: 10s

Fire a non-destructive Wither Skull that deals massive damage to foes.

Ender Dragon

Cooldown: 20s

Fire a Dragon Fireball, which deals AOE damage.

Content Creation Configuration
Looking to use Identity in an online video? You most likely want to disable popups & notifications. Here are a few good configuration options you can change:

Default Option Suggestions

overlayIdentityUnlocks: set to false to disable the hotbar popup notifying you of new Identity unlocks.

showPlayerNametag: set to true to render player nametags when they are disguised as an Identity. Content Configuration Ideas

forceChangeNew: when a player kills a new mob (first-time kill), they will be forcibly swapped into it.

forceChangeAlways: when a player kills any mob, they will be forcibly swapped into it.

enableClientSwapMenu: disables the Identity menu for clients.


 * revokeIdentityOnDeath: when a player dies, they lose their currently equipped Identity.

Disabling for clients
Looking to prevent your players from being able to change their Identity (such as in a roleplay server)? These options might help.

enableClientSwapMenu: set to false to disallow clients from opening the Identity menu through the ` key. Note that this option is non-authoritative, which means a modified client can still request changes from the server. This option is useful for when you want to disable the menu but have some other functionality that allows the client to request swaps from the server. Note that operators bypass this option and will still be able to open the screen if the option is false.

enableSwaps: an authoritative option that allows you to prevent clients from requesting swaps through the API. If enableClientSwapMenu is true, players will still be able to open the menu, but clicking on an entity will not do anything (so it is recommended that you turn both off if this option is false). Operators are able to bypass this functionality. This does not prevent the server from changing the Identity of clients, so you will still be able to force their Identity using commands or the mod API.

By setting both of these options to false, you will have full control over the Identity of players, and they will not be able to request swaps.

Flight Configuration
Free creative flight is a common issue with Identity. Identity provides several configuration options which allow you to tweak this functionality to your liking.

enableFlight: if false, players will not be able to fly while using an appropriate Identity.

advancementsRequiredForFlight: a list describing advancements required before a player can fly using an Identity. For example, a server might gate Identity flight behind the "entering The End" advancement.

flySpeed: allows you to tweak the speed of Identity flight to balance it out. The default value (creative flight speed) is 0.05f. 0.01f is a good value if you want to make flight usable but not unbalanced.

Identity API
Identity provides several events for other mods to hook into.

IdentitySwapCallback

Called when a player attempts to switch Identities. If any listener returns ActionResult.FAIL, the switch is canceled.

IdentitySwapCallback.EVENT.register((player, to) -> {

// 'to' will be null when the user is attempting to switch back into a player.

// Return FAIL to deny the switch.

if(to == null) {

return ActionResult.FAIL;

}   // Return SUCCESS to force the swap.

if(to instanceof CowEntity) {

return ActionResult.SUCCESS;

}   // Default to PASS to allow the next listener to run.

return ActionResult.PASS;

});

UnlockIdentityCallback

Called when a player unlocks a new Identity. If any listener returns ActionResult.FAIL, the player is not granted the Identity.

UnlockIdentityCallback.EVENT.register((player, id) -> {

// Return FAIL to deny the unlock.

if(id.toString.equals("minecraft:wither")) {

return ActionResult.FAIL;

}   // Return SUCCESS to force the unlock and prevent other listeners from running.

if(id.getNamespace.equals("mymod")) {

player.sendMessage(new LiteralText("You just unlocked an Identity from my mod!"), false);

return ActionResult.SUCCESS;

}

// Default to PASS to allow the next listener to run.

return ActionResult.PASS;

});

Kill Requirements
By default, Identities are unlocked the first time you kill a mob. If you prefer to have your players work for Identity unlocks, you can set killForIdentity to true. This will require the player to kill a certain number of entities of a given type to unlock an Identity.

requiredKillsForIdentity defines the default/fallback requirement for each entity type. By default, this is 50, which represents 50 kills to unlock a type. requiredKillsByType offers a map to set the specific requirements for a given type.