looking for a method in the API to trigger a player animation. only thing i can find that allows anything to do with animations has to do with custom items. is there a way to do this int he API that i may be overlooking?
Player Animation's
-
- English
- james1bow
- Thread is marked as Resolved.
A new update is now available, introducing seasons and more!
Latest hotfix: 0.8.0.1 (2024-12-20)
Latest hotfix: 0.8.0.1 (2024-12-20)
-
-
Unfortunately it's not possible to set an animation (this only works in combination with custom items) But this is planned for the new version!
-
Unfortunately it's not possible to set an animation (this only works in combination with custom items) But this is planned for the new version!
my work around is to make a custom item for all 7 gestures. gesture 2 being the one craftable (gesture1 would be to offensive a default gesture ). gestures are used with primary action and clicking the secondary action changes between the other customeitem(1 for each gesture).
will be using a context menu on right click in the future(once i know how to setup/use callbacks).
-
This sounds like a good workaround
will be using a context menu on right click in the future(once i know how to setup/use callbacks).
Callbacks in the Plugin API basically just contain a method which will be invoked once the server gets a response from the client. The particular data the server receives from the client (in this case the selected entry in the context menu, as a String) will be passed as parameter to that method. You can put your own code inside this method by implementing the "Callback" interface.
Instead of writing a whole class which implements that interfacec, you can use "anonymous classes": That's basically just a block of code (the code that would otherwise belong into the "onCall()" method) which will then be executed once the server got the response from the client. It could look like this:
This brings up a context menu with 3 entries ("Option 1", "Option 2" and "Option 3"). The parameter passed to the method is the part in brackets "(String entry)". If the player selects one of these entries (e.g. Option 2), the code below will be executed, i.e. the server will print "Selected entry: Option 2" etc.
-
Thanks for the info! I love learning new things.
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!