Solved Get Light Level

Discussion in 'Plugin Development' started by Bobfan, Nov 28, 2012.

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

    Bobfan

    Like the title says, I want to get the light level for a player. I tried
    Code:
    int l = pA.getLevel();
    but apparently that means level, not light level. How do you get the light level for pA (the player) in an EntityDamageByEntityEvent
     
  2. get the location
    get the block
    get the light level
     
    Bobfan likes this.
  3. Offline

    skipperguy12

    Code:
                Player p = event.getPlayer();
               
                Location l = p.getLocation();
               
               
                Location blockbellowplayer = new Location(l.getWorld(), l.getX(),
                        l.getY() - 1, l.getZ());
               
                if(blockbellowplayer != null){
                    int lightlevel = blockbellowplayer.getBlock().getLightLevel();
                   
                   
                }
    I know its been solved already, i'm bored... soo...here?
     
    Firzen and harl like this.
Thread Status:
Not open for further replies.

Share This Page