{"id":20802169,"url":"https://github.com/cosmoverse/floatingtext","last_synced_at":"2025-05-07T00:46:07.567Z","repository":{"id":45349921,"uuid":"255241202","full_name":"Cosmoverse/FloatingText","owner":"Cosmoverse","description":"A PocketMine-MP plugin to spawn/manage floating texts (aka holograms)","archived":false,"fork":false,"pushed_at":"2024-04-10T18:13:26.000Z","size":66,"stargazers_count":22,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T04:41:12.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://poggit.pmmp.io/ci/Cosmoverse/FloatingText","language":"PHP","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/Cosmoverse.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}},"created_at":"2020-04-13T05:40:41.000Z","updated_at":"2025-02-04T10:44:36.000Z","dependencies_parsed_at":"2024-04-10T19:50:10.259Z","dependency_job_id":null,"html_url":"https://github.com/Cosmoverse/FloatingText","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosmoverse%2FFloatingText","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosmoverse%2FFloatingText/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosmoverse%2FFloatingText/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosmoverse%2FFloatingText/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cosmoverse","download_url":"https://codeload.github.com/Cosmoverse/FloatingText/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252793564,"owners_count":21805054,"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":[],"created_at":"2024-11-17T18:28:31.126Z","updated_at":"2025-05-07T00:46:07.558Z","avatar_url":"https://github.com/Cosmoverse.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FloatingText\nA PocketMine-MP plugin that spawns floating texts (aka holograms).\n\n## Usage\nOnce installed, use `/ft add some \u0026eyellow text \u0026rhere` to spawn a floating text.\u003cbr\u003e\nUse `/ft near` to list all floating texts near you (it also specifies each floating text's ID).\u003cbr\u003e\nUse `/ft delete \u003cid\u003e` to delete a floating text.\n\n## API\nAt the moment, there is no API method available for adding or removing floating texts. This means that all floating texts must be set up manually in the game.\nHowever, the plugin does provide an API to update floating texts by replacing wildcards:\n\nOn plugin enable, register a `FloatingTextHandler` instance by calling `FloatingTextHandlerManager::register($handler)`.\u003cbr\u003e\nThe `FloatingTextHandler` consists of three methods — `canHandle(FloatingText)`, `onSpawn(FloatingText, FloatingTextEntity)` and `onDespawn(FloatingText, FloatingTextEntity)`.\u003cbr\u003e\nIf your `canHandle()` returns true for a specific `FloatingText` (`FloatingText` holds world, x, y, z and the floating text string), then your `FloatingTextHandler` will be notified via `onSpawn` and `onDespawn` methods whenever a floating text gets spawned.\nAs a utility, the plugin ships with a `FloatingTextFindAndReplaceHandler` and `FloatingTextFindAndReplaceTickerHandler` that can be used as follows:\n```php\n/** @var Loader $loader */\n$manager = $loader-\u003egetHandlerManager();\n\n// FloatingTextFindAndReplaceHandler - Used to update static wildcards.\n$manager-\u003eregister(new FloatingTextFindAndReplaceHandler(\n\t\"{MCPE_VERSION}\",\n\tServer::getInstance()-\u003egetVersion()\n));\n// run /ft add \u0026eServer Version: \u0026l{MCPE_VERSION}\n```\n```php\n// FloatingTextFindAndReplaceTickerHandler - Used to update wildcards repetitively.\n$start = time();\n$manager-\u003eregister(new FloatingTextFindAndReplaceTickerHandler(\n\t$plugin,\n\t\"{LAST_ENVOY}\",\n\tfn() =\u003e gmdate(\"i:s\", time() - $start),\n\t20 * 10 // update every 10 seconds\n));\n// run /ft add \u0026bLast envoy was {LAST_ENVOY} ago\n```\n\n## Performance and Resource Consumption\nOnce a world is loaded, the plugin caches all floating texts present in that world into memory, indexing them by their unique IDs.\nFloating texts are implemented as entities and will only stay loaded as long as the chunk they are located in remains loaded.\u003cbr\u003e\nFloatingText also maintains a `chunk -\u003e [id -\u003e entity_id]` mapping to speed up floating text lookup.\u003cbr\u003e\nWhen registering a `FloatingTextHandler`, the plugin calls `FloatingTextHandler::canHandle()` for all loaded floating texts to prepare a list of floating texts that require an update during runtime.\n\nThe floating texts are stored in an `SQLite3` database, and all access to the database is done in a separate thread asynchronously.\nThis means that when a world is loaded, the floating texts will not be displayed until the database has returned the necessary information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmoverse%2Ffloatingtext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmoverse%2Ffloatingtext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmoverse%2Ffloatingtext/lists"}