Height Limit Module
Overview
The height limit module allows servers to control the build-height limit displayed by the Height Limit mod.
- Adds the ability to set a height limit per world, rendered as a block overlay and HUD display.
This module is disabled by default, if you wish to use this module you will need to enable it in config.yml.
This module only provides a visual indicator for the player, the server is still responsible for cancelling block placement above the height limit.
Integration
Sample Code
Explore each integration by cycling through each tab, to find the best fit for your requirements and needs.
Apollo API examples. See General for common patterns and helpers.
Overriding a Height Limit
public void overrideHeightLimitExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(apolloPlayer -> {
this.heightLimitModule.overrideHeightLimit(apolloPlayer, HeightLimit.builder()
.world("world_the_end")
.limit(150)
.displayName(Component.text("The End", NamedTextColor.DARK_PURPLE))
.build()
);
});
}Removing a Height Limit
public void removeHeightLimitExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(apolloPlayer -> this.heightLimitModule.removeHeightLimit(apolloPlayer, "world_the_end"));
}Resetting all Height Limits
public void resetHeightLimitsExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(this.heightLimitModule::resetHeightLimits);
}HeightLimit Options
.world(String) is the world, by name, that you wish to apply the height limit to. Sending a height limit for an already-known world replaces that worlds entry.
.world("world_the_end").limit(Integer) is the Y level where block placement is denied. The highest buildable layer is limit - 1.
.limit(150).displayName(Component) is the optional display name shown on the clients height limit HUD.
.displayName(Component.text("The End", NamedTextColor.DARK_PURPLE))Available options
DEFAULT_HEIGHT_LIMITS- Sets the default height limits to send to the player.
- Values
- Type:
List<HeightLimit> - Default:
- world: world limit: 200 display-name: '&6Overworld'
- Type: