{"id":15920063,"url":"https://github.com/crushedpixel/masqueradeapi","last_synced_at":"2026-01-20T00:41:43.339Z","repository":{"id":93945271,"uuid":"84398260","full_name":"CrushedPixel/MasqueradeAPI","owner":"CrushedPixel","description":"Disguise API for Sponge.","archived":false,"fork":false,"pushed_at":"2017-03-22T14:38:58.000Z","size":158,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T05:44:52.056Z","etag":null,"topics":["disguise-plugin","minecraft","sponge-plugin","spongepowered"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrushedPixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-09T04:29:10.000Z","updated_at":"2023-04-03T11:38:03.000Z","dependencies_parsed_at":"2023-05-07T11:26:14.718Z","dependency_job_id":null,"html_url":"https://github.com/CrushedPixel/MasqueradeAPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2FMasqueradeAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2FMasqueradeAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2FMasqueradeAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2FMasqueradeAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrushedPixel","download_url":"https://codeload.github.com/CrushedPixel/MasqueradeAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247810033,"owners_count":20999816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["disguise-plugin","minecraft","sponge-plugin","spongepowered"],"created_at":"2024-10-06T19:20:55.090Z","updated_at":"2026-01-20T00:41:43.301Z","avatar_url":"https://github.com/CrushedPixel.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MasqueradeAPI\nA disguise API for Sponge.\n\n## Installation\n### Plugin development\nTo use the **MasqueradeAPI** in your project, you need to add it to your Maven/Gradle dependencies.  \nWe suggest using [jitpack.io](https://jitpack.io) to depend on the **MasqueradeAPI** like so:\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.CrushedPixel\u003c/groupId\u003e\n        \u003cartifactId\u003eMasqueradeAPI\u003c/artifactId\u003e\n        \u003cversion\u003emaster-SNAPSHOT\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n### Sponge\nTo run a plugin that depends on the **MasqueradeAPI**, you need to install the [MasqueradePlugin] on your Sponge server.\n\n## Usage\n### The `Masquerades` service\nThe [MasqueradePlugin] registers a Sponge service that exposes an instance of `Masquerades`, which can be used to retrieve instances of `Masquerade`:\n```java\nOptional\u003cMasquerades\u003e optional = Sponge.getServiceManager().provide(Masquerades.class);\nif (optional.isPresent()) {\n    Masquerades masquerades = optional.get();\n    // use Masquerades\n} else {\n    // the MasqueradesPlugin is not installed on the server\n}\n```\n### Masking a player\nTo mask a player, retrieve an instance of `Masquerade` from `Masquerades` and show it to other players.  \nFor example, if you want to mask the Player as a Zombie and show the masquerade to all online players, do:\n```java\nMasquerade masquerade = masquerades.fromType(EntityTypes.ZOMBIE, player);\n\nfor (Player p : Sponge.getServer().getOnlinePlayers()) {\n    // do not show the masquerade to the masked player itself\n    if (p == player) continue;\n    \n    masquerade.maskTo(p);\n}\n```\n\nThe player now looks like a Zombie to all other online players on the server.\n\n### Unmasking a player\nIf you want to unmask the player again, you can either call `Masquerade#unmaskTo(Player)` to unmask them to a specific player \nor `Masquerade#unmask()` to unmask them to everyone.\n\n**Note:** The [MasqueradePlugin] itself does *not* handle Events like clients connecting and disconnecting - for an example implementation, please refer to [MasqueradeCommand].\n\n### Masquerade Data\nYou can manipulate the `Masquerade`'s entity metadata using Sponge `Key`s, for example to display a custom name for the fake entity:\n\n```java\nmasquerade.setData(Keys.DISPLAY_NAME, Text.of(\"Dinnerbone\"));\nmasquerade.setData(Keys.CUSTOM_NAME_VISIBLE, true);\n```\n\nPlease note that some Keys may not be applicable to a certain `Masquerade` type or may not be implemented yet, in which case `setData` will throw an `IllegalArgumentException`.\n\nSome metadata fields are automatically modified by the server, \nfor example `Keys.IS_ABLAZE` will be modified if the masked player walks through fire.  \nYou can easily disable this behaviour for each key separately:\n\n```java\nmasquerade.setValueChangeAllowed(Keys.IS_ABLAZE, false);\n```\n\nNow, the entity will only appear in flames when asked for by the plugin, and otherwise retain the current state.\n\n[MasqueradePlugin]: https://github.com/CrushedPixel/MasqueradePlugin/\n[MasqueradeCommand]: https://github.com/CrushedPixel/MasqueradeCommand/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrushedpixel%2Fmasqueradeapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrushedpixel%2Fmasqueradeapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrushedpixel%2Fmasqueradeapi/lists"}