Guest User

Untitled

a guest
Jan 4th, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. @EventHandler
  2. public void serverTickEvent(ServerTickEvent event) {
  3. if(Mod.PUBLIC_FIELD != null) {
  4. int duration = Mod.PUBLIC_FIELD.getDuration();
  5. if(duration == 5) {
  6. MinecraftServer.getServer().addChatMessage(new ChatComponentText(PREFIX + "This ends in 5 seconds"));
  7. }
  8. if(duration <= 0) {
  9. Mod.PUBLIC_FIELD = null;
  10. MinecraftServer.getServer().addChatMessage(new ChatComponentText(PREFIX+ "This has ended..."));
  11. //give items to players or return original items :)
  12. } else {
  13. Mod.PUBLIC_FIELD.decrementDuration();
  14. }
  15. }
  16. }
Add Comment
Please, Sign In to add comment