Skip to content

Creating custom sidebars

PXAV edited this page Jan 27, 2021 · 3 revisions

This tutorial demonstrates how sidebars are used in kelp-v0.1.0 and above. The old annotation-based sidebar system (v.0.0.5 and below) is not supported anymore.

Creating the Sidebar

There are different types of sidebars offered by Kelp.

Type Description
SimpleSidebar Used to display plain sidebars. Can hold all components, but has a static title.
AnimatedSidebar Can holld all components, but the title can be animated.

We will use the SimpleSidebar first and then look at the differences to the AnimatedSidebar.

To create a new instance of a sidebar, you can call the static factory method of one of the sidebar types.

SimpleSidebar sidebar = SimpleSidebar.create();

sidebar.staticTitle("§b§lWELCOME ON THE SERVER!");
// title won't change if you update it

sidebar.title(() -> "§b§l" + player.getLocation());
// title will change if you call the update method
// and display the latest location of the player

Work in progress

Clone this wiki locally