Solved Triggered event while doing nothing / Triggered Event when rain hits Player

Discussion in 'Plugin Development' started by L33m4n123, Apr 16, 2013.

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

    L33m4n123

    Hey guys!

    I have two questions:

    What Event is being called when a player does nothing? I need to know this because in my plugin Water should act like Lava. You get Damage while being in contact with it. The only issue now is, if he stands still, he does get no damage anymore. But thats exactly what I want avoid. No matter if he moves or if he walkes he should get damage.

    Second question:

    How can I make it that a player gets damaged when he gets hit by Rain like the Enderman?

    Thanks in advance
     
  2. Offline

    ZeusAllMighty11

    1) There is no event when a player does nothing. You could always check after X seconds if the player's first XYZ was the same as their new after scheduler XYZ, then that means they didn't move.

    2) I don't think that's possible - I'm not sure
     
  3. Offline

    evilmidget38

    L33m4n123
    You can achieve both tasks using the Bukkit scheduler. What I'd recommend is this:
    • For damaging players for being in water, run a task that checks ever couple of ticks if each player is in water. If they are, hurt them accordingly.
    • To make rain harm the Player, you can take two different approaches: 1) Have a repeating task that checks every second or so whether or not it's raining, and if it is, harm the players accordingly. 2) Start a repeating task on WeatherChangeEvent to harm the players, and cancel the task when another WeatherChangeEvent is thrown that ends the rain.
     
    L33m4n123 likes this.
  4. Offline

    L33m4n123


    Ok thanks for the Ideas. I will see how I can match them for my need. :3 Will mark it as solved for now until I need more Infos =)
     
Thread Status:
Not open for further replies.

Share This Page