one world no health regen

Discussion in 'Plugin Development' started by monkeymanboy, Jul 21, 2013.

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

    monkeymanboy

    So I am pretty new too making plugins and I already set it up so it disables health regen for my plugin but how would I make it so it only does it in one world
     
  2. Offline

    Lauryman

    I think it's something like getWorld("world"), then basically make that a method then do the disable health regen sequence.
     
  3. Offline

    monkeymanboy

    thanks :D
     
  4. Offline

    ZeusAllMighty11

    On the health regain event,
    if the player regaining health's world is Xworld,
    cancel
     
  5. Offline

    Lauryman

    well you could do that but what if he had 5 worlds so he had to do that 4 times? Personally I think doing the get world thing is easier because it disables it for that world only.
     
  6. Offline

    savagesun

    ...what. Green's idea is more or less exactly what you just said.
     
  7. Offline

    Lauryman


    Basically he said

    If lauryman's regaining health's world is Magic
    setCancelled

    But he wants it so that only one world in particular heals the player, say Porkchop.
    This means that if he has 5 worlds, Porkchop, Magic, World, Fire and MagicallyMagic, he would need to set up the above for Magic, World, Fire and MagicallyMagic.

    However, what I said, is basically just saying to getWorld specifically, Porkchop, and enable healing. Therefore his code would be shorter and a good coder likes a shorter code than a longer code if they are the same because they don't care how complicated it looks.
     
  8. Offline

    monkeymanboy

    Actually I would like to change how its done I want the entire plugin to be unloaded in all worlds except one how would I do it like this instead?
     
  9. Offline

    Lauryman

    Not sure, but the easiest way I can think of is just doing the getWorld thing with the specific world and just cancelling everything out, but that's a waste of time and effort so you might get more help with someone else.
     
Thread Status:
Not open for further replies.

Share This Page