Skip to content
E.J. Mercer edited this page Aug 17, 2018 · 3 revisions

MLAPI is very simple and powerful to use. This page will walk you through creation of a simple controller and tag line.

Step One: Create a Tag Controller.

You should create a class that contains your tag controller implementation. It must extend ITagController. Here is an example:

public class DemoController implements ITagController {
    private final JavaPlugin parent;
    private final ITagController.TagLine line;

    public DemoController(JavaPlugin parent) {
        this.parent = parent;
        this.line = new DemoLine();
    }

    @Override
    public List<TagLine> getFor(Entity target) {
        return Collections.singletonList(this.line);
    }

    @Override
    public String getName(Entity target, Player viewer, String previous) {
        return ChatColor.BLUE + previous;
    }

    @Override
    public EntityType[] getAutoApplyFor() {
        return new EntityType[]{
             EntityType.PLAYER
        };
    }

    @Override
    public JavaPlugin getPlugin() {
        return parent;
    }

    @Override
    public int getPriority() {
        return 0;
    }

    @Override
    public int getNamePriority() {
        return 0;
    }
}

The rest of the guide is TO-DO

Clone this wiki locally