Giter VIP home page Giter VIP logo

minichat's Introduction

MiniChat

A small Chat Plugin for Paper to format the chat using MiniMessage!

Setup

This Plugin requires at least Paper 1.16.5 to function! This Plugin requires LuckPerms to function! Place the jarfile into the plugins folder. Use the LuckPerms Meta manager to set the chatformat in MiniMessage format!

Configuration

minichat:
  format:
    key: minichat.meta # The Meta key used to retrieve the chat format for the user.
    fallback: "<gray><name>: <message></gray>" #If no format is available, this format will be used.

Meta Examples

/lp group admin meta setprefix "<white>[</white><dark_red>ADMIN</dark_red><white>]</white>"
/lp group admin meta set minichat.format "<prefix> <red><name></red>: <white><message></white>"
/lp group default meta set minichat.format "<gray>[Member] <name>: <message></gray>

Default Placeholders

MiniChat provides several placeholders:

  • name
  • message
  • prefix
  • suffix
  • displayName
  • teamDisplayName

Custom Placeholders

It is possible to define custom placeholders. To do this, add the MiniChat as a dependency to your plugin and use the Services manager to acquire an instance of the MiniChat interface.

MiniChat is available through GitHub packages.

<repositories>
  <repository>
    <id>github</id>
    <name>minichat</name>
    <url>https://maven.pkg.github.com/steenooo/minichat</url>
  </repository>
</repositories>
<dependency>
  <groupId>dev.steyn</groupId>
  <artifactId>minichat</artifactId>
  <version>1.0.0</version>
</dependency>

Custom Placeholder Example

import dev.steyn.minichat.api.MiniChat;
import dev.steyn.minichat.api.Placeholder;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider;

class YourPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        RegisteredServiceProvider<MiniChat> service = Bukkit.getServicesManager()
            .getRegistration(MiniChat.class);
        MiniChat miniChat = service.getProvider();
        miniChat.addPlaceholder(this, "team", p -> Component.text("Team1"));
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.