Commander

Programming
Dragonphase - designed for mau5ville.com
Additional Credit
If you have experience with Java and creating Bukkit plugins, I will greatly appreciate the help and am interested with working with developers; I will be rewriting Commander to make it easier to use and more efficient to produce code for.
I am currently looking for someone to help me produce a video demonstration of Commander, demonstrating basic and advanced features. Please message me on bukkit if you are interested - a high standard of demonstrative and/or reviewer abilities is preferred. The reason for this is that most people miss the advanced features or don't understand how to use them.
Overview
Commander is a powerful device interface tool used to assign commands, messages and statements to buttons, levers and pressure plates.
| Features |
|---|
| Add and remove multiple commands to buttons, levers and pressure plates |
| Manually add and edit existing device data in the devices.yml file |
| Check player permissions, items and groups using if-else statements |
| Perform commands as player, op or console |
| Multi-Perms support - Vault required! |
| Add commands to regions - WorldGuard and WorldEdit required! |
How to use
Firstly, make sure you have VAULT installed, as well as any of the permissions plugins it can handle (such as PermissionsEx or bPermissions). This allows permissions detection for all permissions-based systems specified on the Vault page.
Supported Devices
As of right now, only four devices are supported and listed below. Wooden Button will be easy to implement when 1.4 is released. I am currently in progress of developing a tripwire interface system for Commander:
Wooden Pressure Plate, Stone Pressure Plate, Stone Button, Wooden Button, Lever
Command Types
Command Types specify how the command will be run:
Player, Op, Console
You may also use p, o or c Note: it is impossible for non-ops to op themselves using the op command type, as after all commands have been initiated, it de-ops the player. It is possible on a console command type however.
Commands
An explanation of how these commands work is shown when you type the command in-game:
| Command | Description |
|---|---|
| /commander | Display the commander help. You can also use /com |
| /commander add | Add commands to the device you are looking at. See Supported Devices |
| /commander rem[ove] | Remove commands from the device you are looking at |
| /commander clear | Clear the interface of the device you are looking at |
| /commander check | Check all associated commands of the device you are looking at |
| /commander list | Show a list of all devices in all worlds |
| /commander add-entry | Add commands to the region you are standing in |
| /commander add-entry(regionName) | Add commands to the region named regionName |
| /commander rem-entry | Remove commands from the region you are standing in |
| /commander rem-entry(regionName) | Remove commands from the region named regionName |
References
References add a very powerful aspect to the uses of commander. References allow you to display specific traits of the player or the server to the player. References can also be used in messages and statements:
| Reference | Description |
|---|---|
| @player OR @name | Player name |
| @group | Player group name |
| @world | Player world name |
| @time | Player world time |
| @level | Player level |
| @exp OR @xp | Player experience |
| @health | Player health level |
| @food | Player food level |
| @mode OR @gm | Player game mode |
| @server | Server IP |
| @region | Name of the region you are standing in |
Conditional references
With commander, you can force the command to continue on to the next command or stop running any further commands. This is useful when adding conditional statements on devices:
| Reference | Description |
|---|---|
| @continue | Continue to the next command |
| @return | Do not run further commands |
An useful example of this is:
@in admin>@@You are an admin>@return /give @player 57 1
This will check if the player is an admin - if they are in the admin group, it sends a message to them saying "You are an admin" and then gives them one diamond block. if they are not in the admin group, @return sop any other commands from running.
A little note about conditional references
Commands in conditional references are run the same as any other commands - if you specify it to be run as the player, op or console, it will run them as the player, op or console.
Messaging
This plugin would be pretty useless if it didn't have a method to send custom messages to a player's chat screen. All color code formats are supported:
| Reference | Description | Example |
|---|---|---|
| @@Message | Send "Message" to the player who initiates the device | @@Hello @player! |
Statements
Statements allow you to run a command if a condition has been met, else optionally run an alternate command. This is useful if you want players with a specific permissions node, group or item to run a command:
| Statement | Description | Example |
|---|---|---|
| @check | Check if the player has a specific permission node | @check foo.bar>@@Yes>@@No |
| @has | Check if the player has a specific item | @has 35>@@You have wool>@@You do not have wool |
| @in | Check if the player is in a specific group | @in moderators>@@You are a moderator>@@You are a @group |
Manually editing devices
Device data is saved to Commander/devices.yml by default. if you are using an earlier version of Commander, simply rename "commands.yml" to "devices.yml":
Editing devices manually is useful when you have created an empty interface and wish to manually add your own commands to the device. This is also useful when you wish to add commands that cannot be entered into minecraft by default, such as long WorldEdit generation commands.
By defaults, commands in the devices.yml file do not contain a forward slash (/). If you want to add a command, simply write it out without the forward slash. With WorldEdit commands, you need to add one forward slash (instead of two):
| say hello | Normal /say command |
| /wand | WorldEdit wand |
Permissions
| Permission Node | Description |
|---|---|
| commander.device.use.player | Allow players to use player commands on devices (enabled by default) |
| commander.device.use.op | Allow players to use op commands on devices |
| commander.device.use.console | Allow players to use console commands on devices |
| commander.device.break | Allow players to break a device |
| commander.admin.add | Add a command to a device |
| commander.admin.remove | Remove a command from a device |
| commander.admin.clear | Clear a device's interface |
| commander.admin.check | Check a device's associated commands |
| commander.admin.list | List all devices in all worlds |
| commander.admin.reload | Reload commander |
Further Ideas
- I plan to convert all references into statements:
@player Bob>@@You are bob!>@@You are not bob!
@health 20>/give @player 57 1>@@You are not at full health
- Tripwire support
- I have LOOKED INTO adding commands to any block.
Homepage: dragonphase.com
ba55ment: ba55ment.org
-
View User Profile
-
Send Message
Posted Sep 21, 2012Oh upsi, sorry. Well you got it right then, i haven't used it yet though. But sorry again... I got an pretty smart plan, you know buycraft right? If you want to have more packages then you'll need to pay. But you can have 3 free packages though. So if you sell out sponge (wich should be totally unavailble in other ways) you could allow people to buy ranks for sponge that they would have to pay for, and it would be totally free for you to do. Again thanks if you implement it, and otherwise thanks for sharing the plugin.
JungleJoe
-
View User Profile
-
Send Message
Posted Sep 20, 2012@hovedhakker
Commander doesn't use signs... And what I said earlier is what you just said now:
/commander add itemcost 1 10
would be:
@cost 1 10>rank @player donator
-
View User Profile
-
Send Message
Posted Sep 20, 2012Not exact what i meant. Example: I set up an sign. Adds following permission: hat.use Then adds a itemprice: /commander add itemcost 1 (itemID) 10 (quanity)
Something like that.
EDIT: It would allow players to purchase stuff like perms and ranks with items instead of just money.
-
View User Profile
-
Send Message
Posted Sep 17, 2012@Dibujaron
Probably not, for various reasons:
This would require me to hook into the API (if it has one) and update the command references with the new locations. And since this requires too much time and effort on my part (I study full-time at university and am looking for a part-time job), I don't see this happening any time soon. Sorry :(
@hovedhakker
So:
@cost 1>@@Bought an item>@@You need stone
And for the quantity, I could do something such as:
@cost 1 64
@eagleFMJ
Done, sorry for the inconvenience - I cannot add it as a project dependency, but if anyone knows how to do so, please let me know!
-
View User Profile
-
Send Message
Posted Sep 17, 2012Could you make an "cost" option, so that people would either have to pay or have some their items taken?
-
View User Profile
-
Send Message
Posted Sep 16, 2012does anyone know if this will work on a movecraft ship? so that you could use these levers and such to control your ships' speed and all that?
-
View User Profile
-
Send Message
Posted Sep 15, 2012I am getting some errors, CB 1.3.2-R0.1
update: Ok, so like nowhere in the plugin directions/description does it say I must have Vault for this plugin to work. Installed Vault and everything seems fine now, why not mention it somewhere?
-
View User Profile
-
Send Message
Posted Sep 15, 2012@Seaboiii
Maybe the problem is not because of "commander" which seems to work as it should by teleporting you, but because of your servers config that dont allows you to teleport and sends you back with this warning message. I didn't try to teleport with commander but when i use mvPortals my server put the same kind of warning (but allows it anyway). so take a look in your server config files maybe the answer is there ?
Potof.
-
View User Profile
-
Send Message
Posted Sep 15, 2012I still can't get this working with teleporting using pressure plates. I used this plugin with essentials. I added /spawn command on the pressure plate. When I step on the pressure plate, i will be teleported to spawn but in a split second i will land back at the pressure plate. The server log then typed, "moved too quickly". However, this works fine if I use a button. Can anybody help me solve this problem. I think its really cool to step on a pressure plate and be teleported :D
-
View User Profile
-
Send Message
Posted Sep 15, 2012@Dragonphase
Hey, it's the morning in france so i wake up and have a look at commander's page. :) so you are working on syntax addons... by the way i thought about @has reference... ins't it a pitty that you use > "separators" in the syntax ? how can we do somthing like "if the player has more than 10 diamonds then... else..." couldn't it be possible to use other "separators" than > in @has reference ?
an @delay feature is a great idea !!!
would it be possible to implement "cycles" (like "while" command) to execute a command until something is checked positively...
sorry for my approximate english ;)
thanks, Potof.
-
View User Profile
-
Send Message
Posted Sep 14, 2012@potof411
Thanks! I'm trying my best.
I have previously attempted to make a wireless redstone plugin but not had much luck with it. The API provided by bukkit does not really do a great job of supporting getting blocks being powered by redstone. I will have another look at it, however. Hopefully I will be able to come up with a prototype or something. I did foresee this question arising and put in a @delay feature as a temporary "solution" to a fraction of this problem.
-
View User Profile
-
Send Message
Posted Sep 14, 2012@Dragonphase
Greaaaaaat !!!!! it works perfectly !!! your plugin is incredible it makes so many things possible thanks a lot !
my command was for quick testing in fact the final one will be somthing like : - @has 332>@@You still have snowballs>/give @player 332 20
and finally i have a suggestion : why dont you put commands on blocks and execute them when they are activated by redstone ? so that it would work with every activators (plates, wire, etc) and then we could build complex mechanisms with commands AND redstone delays or launch commands every x seconds etc..
Anyway... keep on developping you're doing a great work ! Potof.
-
View User Profile
-
Send Message
Posted Sep 14, 2012@potof411
It was a delayed feature. I've been working on it just now, however i updated the main post this morning before I left the house.
Also, might I point out a slight error? You set up the command wrong - @@ is the start to a message, so you don't need to use it if you're using a command:
I will upload the latest working version now:
Click here for the latest version of Commander!
EDIT: For your goal, i suggest you do this:
This way, it will run if the player has no snowballs at all, whereas your previous way gives them air (this does not clear their inventory)
-
View User Profile
-
Send Message
Posted Sep 14, 2012Great plugin !!!
but i have a little problem... i cant manage to make @has work...
My final goal il to make a kind of snowball refill button to player but only if they dont have anymore... so that if they hit twice the button they dont get twice amount of snowballs.
my comand file looks like this :
and it only says "unknown command"... What is my mistake ? thanks Potof.
-
View User Profile
-
Send Message
Posted Sep 14, 2012@IcingMyYabba
Thanks for your comments, they bring a lot of confidence to me and my coding abilities. I am constantly thinking of new features to add and have come up with a new one that I will implement in 1.4. It will work like the @check function, but will check if the player has a specific item.
Additionally, the @check function will work if you're using any permissions-based plugins that are supported by Vault. In my most recent dev builds, changes I make are easily viewable; since I use DropBox, I'll set up a second folder that will allow you to download the dev builds, and a primary folder that will store the releases. I would use these links rather than the ones in the file section as they are updated more rapidly. The changes to the permissions (players having commander.player by default) aren't made in the recent files section, but I will be releasing 1.4 today which will solve these issues.
Again, thank-you for your support! :)
-
View User Profile
-
Send Message
Posted Sep 13, 2012@Dragonphase Such quick progress on such short notice! My god, a single-manned project updating so rapidly. I have lots of faith in you. Also, I switched to PEX (some 45 groups in total) before you could post your comment :( Doesn't matter, bPermissions was kind of a fag to work with. Thanks for the commandhelper plugin, seems cool, I need something like that. I tried blockcommands, didn't work. Very hard to work with, low UI, doesn't recognize if you, for instance, type in "/bc check", it doesn't let you know thats not a valid command. Just stays silent. So I'm going back to your plugin. Hoping those new nodes you added plus my change of permissions to PEX, will make this plugin work :) Once I learn how to code plugins, I may ask of the privilege of working with you. Will post here on updated status if it ends up working or not.
EDIT: It works, but only with the " commander.* " permission. If I give them the commander.console and commander.op it doesn't work. Any idea why?
EDIT 2: It really works now, but you need to add the "commander.player" permission, regardless of whether it's a player, OP or Console command. the "commander.player" node is NOT add by default. LIAR xD
-
View User Profile
-
Send Message
Posted Sep 12, 2012@IcingMyYabba
it's not really. The reason I use pEx is because at the time of our server creation, it was the only plugin we could use for permissions and the setting up of others were too complicated. we still use it now:
/pex user Username group set Group
But i have commandhelper scripts running /rank User Group
Also, click here for the latest version of Commander! - has improved permissions and additional features (see main post).
I also added a Tickets section.
-
View User Profile
-
Send Message
Posted Sep 12, 2012@Dragonphase
Er.... I have vault already. Do you suggest I get pEx? Also, a more mundane-like question, but is the ingame command interface for pEx (/add user group) simple to use? I got bpermissions but all my administrators complain it's too complicated. Thanks for taking the time!
-
View User Profile
-
Send Message
Posted Sep 12, 2012@IcingMyYabba
Thank-you for providing your problems to me for troubleshooting. As I use pEx, this has never been a problem for me, as pEx supports bukkit's default hasPermission function; the reason for this is because most of my plugins are developed for personal use on my dedicated server alone and I will occasionally share them online. I have considered this and the easiest and less time-consuming method of supporting all top known permissions-based systems is to use Vault, however not many people would see that this is a proper solution to the permissions problem. Unfortunately for them, they will need to deal with it. I will work on a Vault fix for this now.
-
View User Profile
-
Send Message
Posted Sep 11, 2012One, you need a tickets section, two, you need to show what permission plugins are supported. It currently looks as if you don't support bPermissions, because only people who are OPs can successfully press the device and have it execute the specified commands. Believe me when I say I've tried everything, and they can't even execute commands that they are usually allowed to execute, /warp spawn for example. Here is the command that I use for the device. /commander add p warp spawn They have the commander.* node, they are able to manually do the command /warp spawn, and of my testing in various locations, near spawn, in a worldguarded region, and in a plain field, none of it works. HOWEVER, I as op can break the block the device is on, in this case a button on a wood plank, whereas my test subject can not. I hope I have provided enough troubleshooting (Sarcasm test complete) for you to resolve this situation. I tried it on myself and this could be a VERY useful and popular plugin. Thanks, -Yabba