Topic category: Advanced modding
Please forgive me if I've misunderstood the basic concepts of how to call on a class/make it do what I want, I'm just spitballing and hoping someone else knows more than me and can help guide this in a relevant direction.
My mod has entities that can ride a player (like a vanilla parrot), I have the game set to have the mob ride the player if they are tamed to the player and the player right clicks on them. However, I'm having trouble getting them off. I made a key binding (LShift), trying to make it so that if the player presses shift while being ridden, it would eject the entity riding the player. Currently its not working, and I can't really find a pre-generated procedure block that equates to "dismount" or "eject". I dig around in the decompiled source code sometimes for inspiration, and I found a StopRidingEntityTask class. Is there some way I could use this in a custom code procedure block to get the mob to dismount the player?
Ex: the procedure that is triggered upon the player pressing shift would be:
"if (is Event/Target entity being ridden = true), do (custom code StopRidingEntityTask)"