This is a very simple and lightweight plugin. (So lightweight that its source is only 20 lines).
What DotCommand does is remove the leading '.' when commands are typed in chat.
When we're trying to show players how to run commands, we often prefix the command with a '.' in order for it to show up in chat. This is all fine and good, however this can sometimes confuse the more... beginner... players.
To solve this, DotCommand changes the messages of those with the dotcommand.modify permission so that their ./command messages only show up as /command.
For example, if I said " ./command they should run", it would be turned into "/command they should run"
Permissions:
dotcommand.modify: players with this permission will have their ./command messages modified
20-line source:
package com.mdc.dotcommand;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class DotCommand extends JavaPlugin implements Listener {
@Override
public void onEnable(){
Bukkit.getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onChat(AsyncPlayerChatEvent event){
if(event.getPlayer().hasPermission("dotcommand.modify")){
if(event.getMessage().startsWith("./")){
event.setMessage(event.getMessage().substring(1));
}
}
}
}Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta