Welcome to the Hangar Open Beta. Please report any issue you encounter on GitHub!
Avatar for MiniPlaceholders

MiniMessage Component-based Placeholders for Paper, Fabric, Sponge, Folia and Velocity platforms

Report MiniPlaceholders?

MiniPlaceholders

WorkFlow Latest Version Discord Modrinth Downloads GitHub Downloads

MiniMessage Component-based Placeholders for Paper, Fabric, Sponge, Folia and Velocity platforms

Compatibility

  • Paper 1.19.4+
  • Folia 1.20+
  • Velocity 3.2.0+
  • Fabric 1.20+
  • Sponge API 8+

Commands

Velocity

  • /vminiplaceholders parse me "[message with placeholders]"
  • /vminiplaceholders parse player [some-player] "[message with placeholders]"

Paper | Folia | Fabric | Sponge | Krypton

  • /miniplaceholders <parse|help> player [some-player] "[message with placeholders]
  • /miniplaceholders parse player [some-player] "[message with placeholders]"
Example:
  • /miniplaceholders parse me "<player_xp>"
  • /vminiplaceholders parse player 4drian3d "<player_name>"

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")
                .filter(Player.class)
                .audiencePlaceholder("name", (audience, ctx, queue) -> {
                    final Player player = (player) audience;
                    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.getAudiencePlaceholders(player);
        player.sendMessage(miniMessage().deserialize("Player Name: <my-expansion_name>", playerResolver));
    }
}

Kotlin

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

Information

CategoryAdmin Tools
Published onMarch 4, 2023
LicenseApache 2.0
Downloads597
Stars10
Watchers7
Supports Folia
Library

Members