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)"
I just figured this out today, sorry for being so late
Use the default start riding procedure blocks, and then edit the code of that procedure
find what looks like
and replace it with
I'm so glad I figured this out because I was having the same problem and I hope they add stop riding procedure blocks in the future
nevermind should've tested it first :/