I'm somewhat on the right track I think, but I'm looking to make certain entities mountable. The InteractPacket::ACTION_MOUSEOVER seems to be what I need to check for, but I'm not sure what to do at that point to make the mount button show up. If anyone has a clue, I'm all eyes. Thanks. EDIT: I might be completely wrong about needing to check for that, now that I think about it. Meh.
Have you tried using the Entity::DATA_INTERACTIVE_TAG metadata? I think that should be it. PHP: /**@var Entity $entity */$entity->getDataPropertyManager()->setString(Entity::DATA_INTERACTIVE_TAG, "Button Text");
How exactly do you get the client to take it? I've tried setting it before I call spawnToAll() because there seems to be some logic in there that does it, but I haven't managed to get the button to show up yet.
Actually, you have to set the interactive tag to the viewer of the entity, rather than the entity itself.
To make this work properly without too many hacks an API is required, on mouse over in interact packet you should set an interact tag to the player if the entity has one, and if the entity does not, you remove the interact tag. Without the API you can't do that for every entity however, because an entity AI may have it implemented as well, and you'll have to do some hacky delayed task.
Well, I can also just use the DataPacket events and process the packets manually. Also kinda hacky, but also kinda works. ¯\_(ツ)_/¯ Seems obvious now that you mention it... The button is displayed to the player. Oh well. xD