✏️
PlayerListDeluxe
  • Introduction
  • Troubleshoot
  • Configuration
    • Understanding the Config Element
    • Tablist Handlers
    • Sorting Feature
    • Migrating from PlayerListPlus
  • FAKE PLAYER
    • Managing Fake Player
    • Fake Player Placeholder
  • HOW TO
    • Where to put Handler?
    • How to add/remove column
    • Create Staff/VIP Handler
    • Prevent Same Player Showing in 2 Handler
    • Sort Player By Name and Etc
    • List of Player that in Same or in A World
    • Condition Tutorial
  • PLACEHOLDER
    • Using Placeholder From PlaceholderAPI
    • Custom Placeholders
  • API
    • Creating Complex Placeholder
    • Creating Parameterized Placeholder
    • Creating Simple Placeholder
    • Managing your own Tablist
    • Events
    • Skin Toolkit
Powered by GitBook
On this page
  • Introduction
  • Implementing the class

Was this helpful?

  1. API

Creating Simple Placeholder

Introduction

Simple placeholder class allows you to replace placeholder in a string directly.

Implementing the class

public class Example implements SimplePlaceholder {

    public Example() {
        // register this placeholder
        PlaceholderManager.register(this);
    }
    
    @Override
    public String replace(String string, ExtraData data) {
        Player viewer = data.get(ExtraData.DATA_VIEWER);
        if (viewer != null) {
            string = string.replace("$gamemode", viewer.getGameMode().name());
        }
        return string; // must return the string!
    }
    
}
PreviousCreating Parameterized PlaceholderNextManaging your own Tablist

Last updated 5 years ago

Was this helpful?