MiniPlaceholders

WorkFlow Latest Version Discord Modrinth Downloads GitHub Downloads

MiniMessage Component-based Placeholders API for Minecraft Platforms

Compatibility

  • Paper 1.21+
  • Velocity 3.4.0+
  • Fabric 1.21.4+
  • Sponge API 12+

User Usage

Check our user usage wiki

API

Check the available Javadocs

Or check the Developer Wiki

Java

class Main {
    public static void registerExpansion() {
        final Expansion expansion = Expansion.builder("my-expansion")
                .audiencePlaceholder(Player.class, "name", (player, ctx, queue) -> {
                    return Tag.selfClosingInserting(player.getName());
                })
                .globalPlaceholder("tps", (ctx, queue) ->
                    Tag.selfClosingInserting(Component.text(Bukkit.getTps()[0]))
                ).build;
        
        expansion.register();
        
        Player player;
        final TagResolver playerResolver = MiniPlaceholders.audiencePlaceholders();
        player.sendMessage(miniMessage().deserialize("Player Name: <my-expansion_name>", player, playerResolver));
    }
}

Kotlin

fun register() {
    val expansion = expansion("my-expansion") {
        audience<Player>("name") { aud, _, _ -> aud.getName().asClosingTag() }
        global("tps") { _, _ -> Component.text(Bukkit.getTps()[0]).asInsertingTag() }
    }
    
    expansion.register()
    
    val player: Player
    val playerResolver = MiniPlaceholders.audiencePlaceholders()
    player.sendMessage(miniMessage().deserialize("Player Name: <my-expansion_name>", player, playerResolver))
}

Project members

MiniPlaceholders

MiniPlaceholders

Organization

Details

Licensed Apache-2.0
Created 3 years ago
Updated 8 days ago