{"id":23279260,"url":"https://github.com/maximjsx/PassengerAPI","last_synced_at":"2025-08-21T11:31:56.440Z","repository":{"id":241400364,"uuid":"806752050","full_name":"maximjsx/PassengerAPI","owner":"maximjsx","description":"A passenger management API to make cross-plugin compatibility possible. ✈️","archived":false,"fork":false,"pushed_at":"2025-08-06T09:00:19.000Z","size":137,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-06T11:12:30.519Z","etag":null,"topics":["display-entities","minecraft-api","minecraft-passengers","plugin","spigot-api"],"latest_commit_sha":null,"homepage":"https://www.spigotmc.org/resources/passengerapi-entity-passenger-bug-fixes-more.117017/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximjsx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-05-27T20:35:19.000Z","updated_at":"2025-08-06T08:59:25.000Z","dependencies_parsed_at":"2024-11-10T13:21:07.885Z","dependency_job_id":"d0bf1afb-b58d-4dba-8b8a-1e7604ec684d","html_url":"https://github.com/maximjsx/PassengerAPI","commit_stats":null,"previous_names":["max1mde/passengerapi","maximjsx/passengerapi"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/maximjsx/PassengerAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximjsx%2FPassengerAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximjsx%2FPassengerAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximjsx%2FPassengerAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximjsx%2FPassengerAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximjsx","download_url":"https://codeload.github.com/maximjsx/PassengerAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximjsx%2FPassengerAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271470172,"owners_count":24765335,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["display-entities","minecraft-api","minecraft-passengers","plugin","spigot-api"],"created_at":"2024-12-19T22:40:56.686Z","updated_at":"2025-08-21T11:31:56.434Z","avatar_url":"https://github.com/maximjsx.png","language":"Java","readme":"\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://discord.gg/2UTkYj26B4\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Discord_Server-7289DA?style=flat\u0026logo=discord\u0026logoColor=white\" alt=\"Join Discord Server\" style=\"border-radius: 15px; height: 20px;\"\u003e\u003c/a\u003e  \n\u003c/div\u003e\n\n[![Card](https://fancy-readme-stats.vercel.app/api/pin-wide/?username=maximjsx\u0026repo=PassengerAPI\u0026dark_bg=3\u0026theme=snow\u0026height=150)](https://github.com/max1mde/fancy-readme-stats)\n\n\n# PassengerAPI\nPassengerAPI is a Java API that allows you to manage passengers (entities attached to other entities) for multiple plugins.\nIt works as a plugin and provides an easy-to-use interface for adding, removing, and retrieving passengers for any entity,\nregardless of whether the entity exists or not (NPC's, packet based entities...).\n\n# Why Use PassengerAPI?\nIt solves compatibility issues that can occur when different plugins create entities  \n**by sending packets** to players and setting them as passengers.  \nThis can lead to conflicts and unintended behavior like **unmounting of previous set passengers** by other plugins.\n\nFor example this makes these plugins automatically compatible with each other:\n- Better Chat Bubbles\n- ProdigyCape\n- VanillaMinimaps\n- PlayerMounts\n\n# Showcase\n\nhttps://github.com/max1mde/PassengerAPI/assets/114857048/224a9df1-3b22-4176-bfce-40a555fc71a2\n\n\u003e [!WARNING]  \n\u003e PassengerAPI might not be compatible with ProtocolLib.\n\n\u003e [!IMPORTANT]  \n\u003e This plugin **works out-of-the-box!**  \n\u003e Just put it into your plugins folder and restart your server.  \n\u003e _It should fix most entity passenger compatibility bugs with other plugins_\n\u003e\n\u003e BUT if you are a **developer** you can still add/access/remove passengers using this API (Not recommended)!  \n\u003e For example if you want to remove a passenger from an entity, without killing it, this could be usefull.\n\n\n# Commmands:\n\nPermission `passengerapi.commands`\n\n```\n/passengerapi debug \n/passengerapi reload\n```\n\u003e [!TIP]   \n\u003e When you are in debug mode and holding a block in your hand\n\u003e you will get additional debugging in chat.\n\n# Config:\n\n```yml\n# DO NOT TOUCH ANYTHING IN THIS FILE\n# IF YOU ARE NOT 100% SURE WHAT YOU ARE DOING!\n\nAutoPassengerDetection:\n  SetPassengerPacket: true\n  EntityDestroyPacket: true\n  VehicleExitEvent: true\n  VehicleExitPacket: true\n```\n\n\n# Getting Started\n\n1. Add PassengerAPI as a compile-only dependency to your plugin.\n\nGradle:\n```gradle\nrepositories {\n    mavenCentral()\n    maven { url 'https://jitpack.io' }\n    maven { url 'https://maven.evokegames.gg/snapshots' }\n}\n\ndependencies {\n    implementation 'com.github.maximjsx:PassengerAPI:\u003cVERSION\u003e'\n}\n```\n(More information: https://jitpack.io/#maximjsx/PassengerAPI)  \n\n2. Add the following line to your `plugin.yml` file:\n```\ndepend:\n- PassengerAPI\n```\n\nAlso add the plugin [Packet Events](https://www.spigotmc.org/resources/packetevents-api.80279/) to your server\nwhich is required by this plugin!\n\n# Usage\n\n### Obtaining the PassengerActions Instance\n\nTo access the PassengerAPI functionality, you need to obtain the PassengerActions instance:\n\n```java\nPassengerActions passengerActions = PassengerAPI.getAPI(yourPluginInstance);\n```\n\n\u003e [!IMPORTANT]  \n\u003e Do not use `getAPI()` before your onEnable() was called!\n\u003e\n\nReplace yourPluginInstance with the instance of your plugin's main class.  \n(For example with `this` if you use it in your main class)\n\n### Managing Passengers\n\nHere are some examples of how to use the `PassengerActions` interface:\n\nKeep in mind that you can only retrive and remove passengers, which you have set here by using the addPassenger... methods.  \n**Except:** when using the \"global\" methods like getGlobalPassengers.\n\nOnly use the addPassenger.. methods from the api if your entity does not actually exist (Packet based)\nTry using Entity#addPassengers() instead if its a real entity... PassengerAPI will handle that automatically!\n\n```java\n// Add a single passenger\npassengerActions.addPassenger(\u003casync\u003e, targetEntityId, passengerEntityId);\n\n// Add multiple passengers\npassengerActions.addPassengers(\u003casync\u003e, targetEntityId, Set.of(passenger1Id, passenger2Id, ...));\n\n// Remove a single passenger\npassengerActions.removePassenger(\u003casync\u003e, targetEntityId, passengerEntityId);\n\n// Remove multiple passengers\npassengerActions.removePassengers(\u003casync\u003e, targetEntityId, Set.of(passenger1Id, passenger2Id, ...));\n\n// Remove all passengers for a target entity\npassengerActions.removeAllPassengers(\u003casync\u003e, targetEntityId);\n\n// Get all passengers for a target entity\nSet\u003cInteger\u003e passengers = passengerActions.getPassengers(targetEntityId);\n\n// Remove global passengers (passengers set by all plugins)\npassengerActions.removeGlobalPassengers(\u003casync\u003e, targetEntityId, Set.of(passenger1Id, passenger2Id, ...));\n\n// Remove all global passengers for a target entity (passengers set by all plugins)\npassengerActions.removeAllGlobalPassengers(\u003casync\u003e, targetEntityId);\n\n// Get all global passengers for a target entity (passengers set by all plugins)\nSet\u003cInteger\u003e globalPassengers = passengerActions.getGlobalPassengers(targetEntityId);\n```\n\n\u003e [!NOTE]   \n\u003e All entities are identified by their entity ID (not UUID).\n\n### Listening to events\n\nPassengerAPI also provides events that you can listen to and handle accordingly:\n\n```java\n@EventHandler\npublic void onAddPassenger(AsyncAddPassengerEvent event) {\n    // The name of the plugin which tries to add these passengers\n    String pluginName = event.getPluginName();\n    int targetEntity = event.getTargetEntityID();\n    Set\u003cInteger\u003e passengers = event.getPassengerList();\n}\n\n@EventHandler\npublic void onRemovePassenger(AsyncRemovePassengerEvent event) {\n    String pluginName = event.getPluginName();\n    int targetEntity = event.getTargetEntityID();\n    Set\u003cInteger\u003e removedPassengers = event.getPassengerList();\n    // Perform actions with these properties\n}\n\n@EventHandler\npublic void onPassengerPacket(AsyncPassengerPacketEvent event) {\n    int targetEntity = event.getTargetEntityID();\n    Set\u003cInteger\u003e passengers = event.getPassengerList();\n    // Which players should receive the packet (You can modify that list)\n    List\u003cPlayer\u003e receivers = event.getPacketReceivers();\n}\n```\nDon't forget to register your event class \n\n\n# Contributions are welcome!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximjsx%2FPassengerAPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximjsx%2FPassengerAPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximjsx%2FPassengerAPI/lists"}