Conflicting plugin commands? Look no further! Use command aliases!

For everyone wondering why you’re commands are not working or acting weirdly, I wish to help!

This gives a more in depth explanation of Sponge Docs global.conf.

You may have noticed that certain plugins have similar or the same commands. This can cause sponge to not properly register which plugins should fire code when a conflicting command is typed!

This can make commands not work even if the permissions are set for the group you’re assigned to.

Do not worry! There is an easy fix! It is built right into Sponge! :smiley:

Find your config/sponge file pathway. This will usually look something like this:

C:\user\ThornsOfire\Desktop\MyServer\config\sponge

Open the global.conf file with something like NotePad++.

Now find this in the file:

}
commands {
    aliases {}
}

This is the culprit!

What this does is tell sponge which plugins should be used for what commands! It allows you to choose which commands take priority when a player uses said command.

To specify which plugins you want you just have add in a couple lines mixed with formatting.

For example, say you want to use EssentialCmds version of /warp or /home instead of Project Portals. You would change the code to look like this:

}
commands {
    aliases {
        back=EssentialCmds
        home=EssentialCmds
        portal=PJP
        vanish=vanish
        warp=EssentialCmds
        spawn=Minecraft
    }
}

Notice that there are no /'s! They are not necessary. Also you only need to type the base command, you do not need to type “home create” or “home delete” separately.

If you’re wondering how to find the plugin id, look at you’re server start log. When the plugin starts you will see something like this:

[21:54:17] [Server thread/INFO] [PJP]: Project Portals has started!
[21:54:17] [Server thread/INFO] [EssentialCmds]: EssentialCmds has started!
                                   ^
The plugin id is this section here ^

Update: Total forgot that there is the clickable text interface! Type “/sponge plugins” then click on the plugin name in chat! This will show your versions and plugin ID :smiley:

Now you may have noticed that the global.conf is available through every dimension and world running on you’re server! This allows you to have one set of commands such as /home from EssentialCmds running on a specific world, while at the same time, Project Portals /home runs on a separate world. This could allow world specific homes to a degree! This has many implications so I will just leave it up to both your imagination and ingenuity.

I hope this topic has helped you :slight_smile:

Long Live Minecraft! <3

6 Likes

I would also note that conflicting commands can be ran by specifying the plugin id before the command. For example /pjp:home and /EssentialCmds:home

3 Likes

Thank you for the guide. It was driving me bananas why Project Worlds kept giving me a syntax errors :slight_smile:

1 Like

This is a little off topic but mentioning Project Portals, you can disable the commands you don’t plan on using in the config…just saying.

4 Likes

And that is exactly what we have done on IllusionCraft! :smiley:

We use you’re custom portals, buttons, signs, ect. We just cancel out the warps and homes. We are considering using both plugins but specifying certain sets of commands to certain worlds, in essence creating for example something like PvP world specific homes and creative world specific homes!

PJP is great addition to our server and we look forward to future updates!

2 Likes

For the hundreds of folk who read this and thought, “AWESOME!” but didn’t post it…

AWESOME! THANKS!

1 Like

I totally saw that in config and loved it! I hope other plugin devs use similar methods :smiley:

ALL THE OPTIONS!!!

Thanks dude! Glad it helped!

Also @TrenTech, EssentialCmds is breaking off their worlds control into a sepparate .jar! Should prevent further errors new users are having! Plus I enjoy having a dedicated world control plugin!

Everytime i start the server the global.conf is reset, do you know why ?

@blood since you recently altered the config… any chance you broke something here?

Enter your .json file into an online parser such as this!

It should show you if you have any syntax (formatting) errors. Hope that helps! :slight_smile:

I have a problem, I did the same the post did but EssentialCmds still uses the command i wish it didn’t use

my config:

   # reported, you may disable this.
    verbose=false
}
commands {
    # A mapping from unqualified command alias to plugin id of the plugin that should handle a certain command
    aliases {
        back="io.github.hsyyid.essentialcmds"
        home="io.github.hsyyid.essentialcmds"
        portal="com.gmail.trentech.pjp"
        vanish=vanish
        warp="io.github.hsyyid.essentialcmds"
        world="com.gmail.trentech.pjw"
    }
}
# This setting does nothing in the global config. In dimension/world configs, it allows the config to override config(s) that it inherits from

I dont know why but these are ID’s that i have, also

[21:21:59] [Server thread/INFO] [io.github.hsyyid.essentialcmds]: [Server] executed command world
[21:21:59] [Server thread/INFO]: Not enough arguments!

^it’s supposed to be a Project World Command
I have been trying to fix this all day but this keep happening, any ideas?

1 Like

You’re using fully qualified plugin ID’s. It might be worth trying the simpler name - ie.
world=PJW, warp=EssentialCmds, etc.
I think the requirement for fully-qualified plugin ID’s has been shelved.

1 Like

What @Inscrutable said! :slight_smile:

Try this:
commands { aliases { back=EssentialCmds home=EssentialCmds portal=PJP vanish=Vanish warp=EssentialCmds world=PJW } }

PS. It is case sensitive I believe. Make sure to check if letters are capitalized. If you are unsure of the simple name type “/sponge plugins” then click on the plugin in question!