Apollo
Developers
Modules
Beam

Beam Module

Overview

The beam module allows you to create custom beams resembling beacon beams, which can be placed on your server to highlight specific points of interest.

  • Backports all vanilla Minecraft beacon beam functionality, found on 1.8+ to the 1.7 version of Lunar Client.
  • Adds improvements to beacon beams for Lunar Client users.
    • Customizable colors for beams, different from the vanilla Minecraft colors.
    • Exact location pinpointing for the beams to be shown on.
    • Beams appear through blocks, unlike in vanilla Minecraft.

Beam Module Example

Beams can be at any location and be any color!

Integration

Sample Code

public void displayBeamExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
 
    apolloPlayerOpt.ifPresent(apolloPlayer -> {
        this.beamModule.displayBeam(apolloPlayer, Beam.builder()
            .id("spawn-beacon")
            .color(Color.CYAN)
            .location(ApolloBlockLocation.builder()
                .world("world")
                .x(0)
                .y(60)
                .z(0)
                .build()
            )
            .build()
        );
    });
}

Beam Options

.id(String) should include a unique identifier for the beam.

.id("spawn-beacon")

.color(java.awt.Color) is how you dictate the color of the beam. See the colors page for more.

Color Types

The java.awt.Color class statically exposes some colors, although they do not correspond to any existing colors used in Minecraft.

.color(Color.CYAN)

.location(ApolloBlockLocation) used to determine the exact block you want the beam to be displayed on. See the locations utilities page for more.

.location(ApolloBlockLocation.builder()
    .world("world")
    .x(0)
    .y(60)
    .z(0)
    .build()
)

Removing a specific beam for a player

public void removeBeamExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(apolloPlayer -> this.beamModule.removeBeam(apolloPlayer, "spawn-beacon"));
}

Resetting all beams for a player

public void resetBeamsExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(this.beamModule::resetBeams);
}