Need help with Plugin

Discussion in 'Plugin Development' started by DragsZombies, Sep 25, 2012.

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

    DragsZombies

    I'm making a plugin where if a player is outside at night, he takes damage. When he is wearing a special "mask" it doesn't make him take damage. I've gotten most of it kinda ok, but I was looking at a youtube video on how to make a plugin that allows you to send a message, so I might have it wrong. Can anyone help me with this? I'm new to making plugin's and I am not exactly sure what certain methods do.


    Thanks!

    DragsZombies
     
  2. Offline

    stuntguy3000

    Hmm, So for example the "mask" is like a leather cap?
    I don't think there is a way to check if you are 'outside', because the only way i think this would work is that if you are (basically) under a block, your inside, no block above = outside.

    And that has its flaws :/
     
  3. Offline

    DragsZombies

    It does. But, they also can be other ways? Possibly have people get damaged no matter what without wearing that "mask" Is there a way to do that?

    What I am trying to do is, damage a player, who is exposed to that kind of "air" which is toxic, and the only way they don't die, is by using that specific item, like a leather cap.
     
  4. Offline

    Muddr

    correct. There is no inside/outside checking.. just the ability to see if there's something above you.. Even light levels wouldn't help much.
     
  5. Offline

    DragsZombies

    Yes, precisely. I'm just trying to get it to damage a player at night, which I know could be possible, since there are plugins that lower a players Hearts due to "vampirism" . That's just what I know anyway.
     
  6. Offline

    Muddr

    You're gonna need a task running to always check every x ticks. http://wiki.bukkit.org/Scheduler_Programming
    the task will then, check the server time, if it's dark, get all online players, then have to loop through them and see if they are wearing the item.. then if not damage them.
     
  7. Offline

    DragsZombies

    So are you asking that, when it is dark, you go around through all the online players, and damage them? I was thinking more like, an automated damaging system. There could possibly be a series of "ticks" that the Scheduler Programming could do, that would simulate night and day. Usually, a full Minecraft day is about, 20 or so minutes, leaving, around, 24000 ticks every 20 minutes. Assuming that my calculations are correct.


    I'm looking for help, please post if you know some stuff for plugin coding.
     
Thread Status:
Not open for further replies.

Share This Page