2727import net .wurstclient .settings .ColorSetting ;
2828import net .wurstclient .settings .EnumSetting ;
2929import net .wurstclient .settings .EspBoxSizeSetting ;
30+ import net .wurstclient .settings .SliderSetting ;
3031import net .wurstclient .settings .filterlists .EntityFilterList ;
3132import net .wurstclient .settings .filters .*;
3233import net .wurstclient .util .EntityUtils ;
@@ -87,6 +88,13 @@ public final class MobEspHack extends Hack implements UpdateListener,
8788 "Appends the number of detected mobs to this hack's entry in the HackList." ,
8889 false );
8990
91+ // Above-ground filter
92+ private final CheckboxSetting onlyAboveGround =
93+ new CheckboxSetting ("Above ground only" ,
94+ "Only show mobs at or above the configured Y level." , false );
95+ private final SliderSetting aboveGroundY = new SliderSetting (
96+ "Set ESP Y limit" , 62 , -65 , 255 , 1 , SliderSetting .ValueDisplay .INTEGER );
97+
9098 private int foundCount ;
9199
92100 public MobEspHack ()
@@ -99,6 +107,8 @@ public MobEspHack()
99107 addSetting (useRainbow );
100108 addSetting (color );
101109 entityFilters .forEach (this ::addSetting );
110+ addSetting (onlyAboveGround );
111+ addSetting (aboveGroundY );
102112 addSetting (showCountInHackList );
103113 }
104114
@@ -129,6 +139,9 @@ public void onUpdate()
129139 .filter (LivingEntity .class ::isInstance ).map (e -> (LivingEntity )e )
130140 .filter (e -> !(e instanceof PlayerEntity ))
131141 .filter (e -> !e .isRemoved () && e .getHealth () > 0 );
142+ // optionally filter out mobs below the configured Y level
143+ if (onlyAboveGround .isChecked ())
144+ stream = stream .filter (e -> e .getY () >= aboveGroundY .getValue ());
132145
133146 stream = entityFilters .applyTo (stream );
134147
0 commit comments