Rawrstin Posted May 22, 2016 Share Posted May 22, 2016 Hey y'all, Is there a way to detect if your character is underground? Trying to figure out the best way to detect if I'm near... Hill Giants. Would my getZ() == -1? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
MattGP Posted May 22, 2016 Share Posted May 22, 2016 Npcs.closest("HIll Giants")!=null Quote Link to comment Share on other sites More sharing options...
Chris Posted May 22, 2016 Share Posted May 22, 2016 Hey y'all, Is there a way to detect if your character is underground? Trying to figure out the best way to detect if I'm near... Hill Giants. Would my getZ() == -1? Thanks in advance! Check your Z plane or define an area inside the dungeon and check if it contains your player. Quote Link to comment Share on other sites More sharing options...
Man16 Posted May 22, 2016 Share Posted May 22, 2016 Most of the time if you are in a dungeon your y-cord is > 9000. Also check if hill giants are there or not to determine where the player is. Quote Link to comment Share on other sites More sharing options...
Apaec Posted May 22, 2016 Share Posted May 22, 2016 Open the entity debugger and hover over a position. This will tell you it's x,y and z position. The z position will therefore be the same as the rest of the dungeon. However there are some dungeons and rooftops with z co-ords of 0 (and if my memory serves correctly hill giants may well be one of them?) so if that is the case then you can always create an area and check if you're in it. Alternatively, seeing as u just climbed down a ladder, you could check whether the ladder has a 'climb-up' option instead of a 'climb-down' option ~apa 3 Quote Link to comment Share on other sites More sharing options...
September Posted May 22, 2016 Share Posted May 22, 2016 I'm pretty sure all dungeons have a z plane of 0 there is no lower plane. Quote Link to comment Share on other sites More sharing options...
Rawrstin Posted May 22, 2016 Author Share Posted May 22, 2016 Open the entity debugger and hover over a position. This will tell you it's x,y and z position. The z position will therefore be the same as the rest of the dungeon. However there are some dungeons and rooftops with z co-ords of 0 (and if my memory serves correctly hill giants may well be one of them?) so if that is the case then you can always create an area and check if you're in it. Alternatively, seeing as u just climbed down a ladder, you could check whether the ladder has a 'climb-up' option instead of a 'climb-down' option ~apa Thanks a million! Quote Link to comment Share on other sites More sharing options...