Ban Management

Ban Management

193k Downloads

How to get onBan event ?

fede1132 opened this issue ยท 6 comments

commented

Hi, i want get onBan event(When staffer ban other player event), how to do that ?

commented

Very thanks, now work. You are the best !

commented

Last question: When i use event.getBan().getExpires() give me the expire date in ticks/second how to get example: 14d or 2 weeks ?

commented

You should get the unix timestamp when the ban expires.
https://github.com/BanManagement/BanManager/blob/master/src/main/java/me/confuser/banmanager/BmAPI.java#L141
From that point forward you have to calculate the date on your own. Should be an easy one.

Date date = new Date ();
date.setTime((long)unix_time*1000);
commented

What is the variable unix_time ?

commented
Date date = new Date();
date.setTime(event.getBan().getExpires() * 1000L);