player taking damage after certain amount of time?

Discussion in 'Plugin Development' started by DragsZombies, Mar 29, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    I'm trying to get my plugin to damage players every certain amount of seconds, but for some reason it's not working. I have the damage setup and the time, but it's not wanting to work.
  2. Offline


    Can you post your code here? It will help us allot.
  3. Offline


    public boolean isDamageTime(Player player){
            Long curTime = player.getWorld().getTime();
            if (curTime>=13800&&curTime<=22200){
                Long nighTime = 24000-curTime;
                if ((nighTime/tickdelay)==Integer.parseInt(Long.toString((nighTime/tickdelay)))){
                    return true;
                return false;}
            return false;}
        public void onPlayerMove(PlayerMoveEvent evt){
            Player player =evt.getPlayer();
            ItemStack Hat = player.getInventory().getHelmet();
            if (Hat.getType()!=Material.IRON_HELMET){
                if (isDamageTime(player)){
    I'm not sure if that's the entire thing, but if you need more, just tell me.
Thread Status:
Not open for further replies.

Share This Page