God mode

Discussion in 'Plugin Development' started by Plukkies, Jul 3, 2014.

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

    Plukkies

    I'm working for a lobby plugin, how can I make godmode?
     
  2. Offline

    teej107

    Explain what "godmode" is?
     
  3. Offline

    Dubehh

    Plukkies
    Code:java
    1. @EventHandler
    2. public void onDamage(EntityDamageEvent){
    3. if(e.getEntity() instanceof Player){
    4. Player p = (Player) e.getEntity();
    5. if(someList.contains(p){
    6. e.setcancelled(true);


    Not sure if PlayerDamageEvent works
     
  4. Offline

    Necrodoom

    Dubehh spoonfeeding has stopped being funny several months ago.
     
    DogeDev likes this.
  5. Offline

    Plukkies

    GodMode is gamemode survival with no damage and feed
     
  6. Offline

    unon1100

    A few steps:
    1. Create a set of all UUIDs of players who should be in GodMode. (If all players should, ignore)
    2. Create listeners for EntityDamageEvent and FoodLevelChangeEvent.
    3. Cancel the event if the set contains the player that the event calls upon.
     
  7. Offline

    Coobro_FTW

    Just cancel the events. It's pretty simple just think about it.
     
Thread Status:
Not open for further replies.

Share This Page