5zig / The-5zig-API

The official client API of The 5zig Mod.
Apache License 2.0
11 stars 2 forks source link

[question] listen to player kills/deaths #4

Closed Wqrld closed 7 years ago

Wqrld commented 7 years ago

is there a way to get the player kills/deaths since the last login? If possible with a event being fired when you are killed/make a kill. If not, i would really like that feature

Wqrld commented 7 years ago

found the stats. But are events for kilsl already implemented?

Wqrld commented 7 years ago

And how do you get the variables out of the api? sorry, it's been a long time since i last used java.

5zig commented 7 years ago

Unfortunately, there is no way of telling on the client's side how a player got killed, that's why there are no events for that in the Api. Regarding your second question, try going through the example plugins in the repository.

Wqrld commented 7 years ago

i did that but i wasn't able to access data from the gamemode class and its not in The5zigAPI.getAPI(). So how can i access the api from the gamemode class?

5zig commented 7 years ago

Either from within the GameModeItem or the AbstractGameListener

Wqrld commented 7 years ago

thanks

Wqrld commented 7 years ago

sorry for me doing really dumb but can you give me a example of how to access it? It could be my setup but it seems like i can't access any of those classes

5zig commented 7 years ago

You need to register them first. Just download the first example plugin from the repository and modify it by your needs.

Wqrld commented 7 years ago

ok ill try that

edit: wait... does this only work if the server has the game states implemented?

5zig commented 7 years ago

No, the server does not need to implement anything.