{"id":18187746,"url":"https://github.com/tgross03/interaction-api","last_synced_at":"2026-02-10T02:02:47.280Z","repository":{"id":258878226,"uuid":"865687216","full_name":"tgross03/Interaction-API","owner":"tgross03","description":"A Spigot API for managing interactions with items.","archived":false,"fork":false,"pushed_at":"2024-11-03T23:57:08.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T22:45:12.400Z","etag":null,"topics":["api","framework","java","minecraft","spigot"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/artifact/dev.edgetom/interaction-api","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/tgross03.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-10-01T00:30:57.000Z","updated_at":"2024-11-24T18:07:00.000Z","dependencies_parsed_at":"2025-04-09T22:40:40.465Z","dependency_job_id":"231a119d-b8ec-4972-befc-7b3a7cdcaf7c","html_url":"https://github.com/tgross03/Interaction-API","commit_stats":null,"previous_names":["tgross03/interaction-api"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tgross03/Interaction-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgross03%2FInteraction-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgross03%2FInteraction-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgross03%2FInteraction-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgross03%2FInteraction-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tgross03","download_url":"https://codeload.github.com/tgross03/Interaction-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgross03%2FInteraction-API/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270108337,"owners_count":24528758,"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-12T02:00:09.011Z","response_time":80,"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":["api","framework","java","minecraft","spigot"],"created_at":"2024-11-03T02:03:08.893Z","updated_at":"2026-02-10T02:02:47.206Z","avatar_url":"https://github.com/tgross03.png","language":"Java","readme":"![Maven Central Version](https://img.shields.io/maven-central/v/dev.edgetom/interaction-api?style=flat\u0026logo=sonatype\u0026color=%2300bf33\u0026link=%3Curl%3Ehttps%3A%2F%2Fcentral.sonatype.com%2Fartifact%2Fdev.edgetom%2Finteraction-api%3C%2Furl%3E)\n![example workflow](https://github.com/tgross03/Interaction-API/actions/workflows/maven.yml/badge.svg?event=push)\n\n# Interaction-API\n\nA Spigot API for managing interactions with items.\n\n\u003e [!WARNING]  \n\u003e At the moment the API is designed and tested for Spigot version `1.19.4`!\n\u003e Other versions will be usable in the future.\n\n## Include the API in your project\n\n### Maven (Recommended)\n\nYou can include the package as a dependency in Maven.\nFor that you have to include the following entry in your `pom.xml` in the surrounding\n`\u003cdependencies\u003e ... \u003c/dependencies\u003e`:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.edgetom\u003c/groupId\u003e\n    \u003cartifactId\u003einteraction-api\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n\u003c/dependency\u003e\n```\nReplace the placeholder `VERSION` with the version you want to use. You can find the all versions of\nthe API in the [Maven Central Repository](https://central.sonatype.com/artifact/dev.edgetom/interaction-api).\n\n### Gradle\n\nAlternatively you can include the API via Gradle:\n\n```Gradle\nimplementation group: 'dev.edgetom', name: 'interaction-api', version: 'VERSION'\n```\n\nReplace the placeholder `VERSION` with the version you want to use. You can find the all versions of\nthe API in the [Maven Central Repository](https://central.sonatype.com/artifact/dev.edgetom/interaction-api).\n\n## Basic usage example\n\n1. You will need to create an `InteractionManager` which will handle the calls to the Interactions.\n   There should only be one `InteractionManager` for your project.\n   Initialize it like this:\n   \n   ```java\n   InteractionManager interactionManager = new InteractionManager(plugin);\n   ```\n\n2. Create your own Interaction by inheriting from the class `InteractionExecutor `.\n   For example like this:\n\n   ```java\n   // Create a new class with an arbitrary name extending the class InteractionExecutor\n   public class TestInteraction extends InteractionExecutor {\n\n       // Create an constructor for the interaction fitting the use case\n       public TestInteraction(@NotNull InteractionManager interactionManager, String interactionKey, boolean placeable, ActionClass actionClass) {\n           super(interactionManager, interactionKey, placeable, actionClass);\n       }\n\n       // Override the execute method, which will be called if a player interacts with an item referencing this interaction\n       @Override\n       public void execute(PlayerInteractEvent event, Player player) {\n   \n           // Send a message to the player who caused the interaction\n           event.getPlayer().sendMessage(\"Click!\");\n       }\n   }\n   ```\n\n3. Initialize the `InteractionExecutor`, create an `ItemStack` and \"connect\" it to the `InteractionExecutor`.\n\n    The following example assumes the usage of an ItemBuilder\n\n    ```java\n    TestInteraction testInteraction = new TestInteraction(plugin.getInteractionManager(), \"test_interaction\", false, ActionClass.RIGHT_CLICK);\n    \n    // Creating a stick\n    ItemStack itemStack = new ItemStack(Material.STICK);\n    \n    // Adding the InteractionExecutor key to the ItemStack. This will make sure that the ItemStack is being assigned to the executor if someone interacts with it\n    itemStack = testInteraction.addToItem(itemStack);\n    \n    ```\n\n    Voilà, the item you just created will now trigger the `TestInteraction#execute()` method and will inform the user of the item of the fact he just clicked with your item.\n\n\u003e [!NOTE]  \n\u003e Your `ItemStack` has to have a valid `ItemMeta` in order to be connected to the `InteractionExecutor`.\n\u003e It is recommended to use a kind of ItemBuilder (like for example [this one](https://github.com/Acquized/ItemBuilder)) to ensure the\n\u003e existence of an `ItemMeta`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgross03%2Finteraction-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftgross03%2Finteraction-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgross03%2Finteraction-api/lists"}