Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

no fall damage

Comments in 'Plugin Development' started by GamesLoad, May 28, 2015.

  1. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    Hello can you tell me to come to set the decline damege thanks to zero
  2. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
  3. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    PHP:
        public function onEntityDamage(EntityDamageEvent $event){
            if (
    $event->getEntity() instanceof Player){
            
    $cause $event->getCause();
            if (
    $cause === 4$event->setCancelled();
            }
        }
  4. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Just two simple questions: How many causes are there?
    Where should I add a line of code to check if player is in a world?
  5. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Look at "EntityDamageEvent" to get all the causes with their code ;)
    Legoboy0215 likes this.
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Bad practice. Good practice is to use the constant reference instead of hardcoding the constant value, as it might change anytime.

Share This Page

Advertisement