CBWrapper
CBWrapper
Concept
Have you ever wanted to be able to use WorldEdit from command blocks? Or other plugins, too, whose commands won't work from command blocks. Well, this is the plugin for you! When the command /cw is run from a command block, it will create a dummy player where the command block is and run the command specified in the command parameters!
News
Some people (everybody) were getting issues between CBW 1.8_alpha, Essentials, and a few other plugins. These conflicts are a side effect of how CBW 1.8_alpha works and is what I hoped wouldn't happen. Avyge1l came up with a solution, which I have now implemented. The plugin now works almost exactly the same way it did in 1.7, but it works for 1.8 still.
Installation
Standard bukkit plugin installation; download the CBWrapper.jar and stick it in your plugins folder
Source Code
Version | Source Link |
Development Version | https://github.com/misson20000/CBWrapper |
Version 1.8.3 (current) | https://github.com/misson20000/CBWrapper/tree/v1.8.3 |
Version 1.8 | https://github.com/misson20000/CBWrapper/tree/v1.8 |
Version 1.8_alpha | https://github.com/misson20000/CBWrapper/tree/v1.8-playerlist |
Usage
If anything doesn't make sense, you might want to consult this page, which I think is a bit more friendly but less clear.
Just tell me how to use the plugin as fast as you can
Put /cw
in front of your commands and remove the first slash. WorldEdit commands will have one slash left and other commands will have no slashes left. Use commands just like you would as a player. Look at the examples for complicated things
That was great but didn't make much sense
That's what this section is for. Here I'll explain everything in more detail
CBWrapper adds one command, /cw for use in command blocks. The general usage is as follows:
/cw [-u username] [-w world] [ -o x y z] <command> [arguments]
For many purposes, however, simply
/cw <command> [arguments]
is sufficient.
The /cw command create a fake player and runs the command as it. This allows you to use commands from plugins that would usually only work for players. The best example of this would be WorldEdit. WorldEdit is usually meant for only players to use, and has no support for command blocks. Using the /cw command, you can trick WorldEdit into thinking that a player is using it and allow the operation.
Say you wanted a command block system to reset a spleef arena every time a new round starts.
You could put a command block at each corner to run the WorldEdit selection commands //pos1
and //pos2
and another
command block to replace the empty blocks with snow or whatever material you are using.
What if I want to have the command blocks far away? No problem. Use the -o option. -o originally stood for offset, but now it would make more sense as -p for position. Oh well. You give it 3 numbers, which are interpreted as coordinates. And numbers starting with a ~
will be interpreted as relative, so -o 5 ~0 -4
would mean run the command at X coordinate 5, use the command block's Y coordinate, and Z coordinate -4.
How about selecting regions in different worlds? Use the -w for world option. It takes one parameter: the name of the world to run the command in. Usually this would be "world", "world_nether", or "world_the_end." If you have Multiverse or something installed, the name of the multiverse world should work too. The -w option is best used with -o, because otherwise your command will be run in the same position, but in the nether or whatever world you specify.
That's great, but how can I prevent my selections from colliding? Pretend to be different players with the -u option. It takes one parameter: the username it pretends to have. WorldEdit thinks it's different players, but it actually isn't any players at all. It's just command blocks.
Examples
Select corner 1 of a WorldEdit selection: /cw /pos1
Select corner 2 of a WorldEdit selection: /cw /pos2
Replace blocks in selection: /cw /replace air snow
Make sure you don't use /set or /wall, as those might delete your command blocks!
Ban whoever dares approach the command block and pretend that someone else did it: /cw -u @r ban @p
Select a corner 2 blocks above the command block /cw -o ~0 ~2 ~0 /pos1
Select the coordinates (0, 0, 0) in the nether: /cw -w world_nether -o 0 0 0 /pos1
Stop the server: /cw stop
Help me it still doesn't make sense!
Leave a comment below. Post the commands you tried, what you're trying to do, and anything else you think would be helpful.
Be careful with the wiki formatting, it can mess things up. Usually putting {{{
and }}}
around your commands helps
Permissions
There is only one permission node, "cbwrapper.cb", for the /cw command
Other Notes
- The dummy player's username, by default, is "@"
- The dummy player's position is the position of the command block it was run from, unless you use the -o flag
- The dummy players isn't actually registered as a player, so you can't teleport people to it or anything
- The dummy player is an op with all permissions. The only bit of security is that the dummy player is only created by command blocks, which can only be edited by ops in creative mode
If you comment anywhere other than this page, I probably won't see it for at least a few months. PMs are fine, too
Spent some time looking, and can't figure out what the problem is. I can run a simply msg command through cw but I can't load a schematic, this is what the log shows when I try to. I can ofc load a schem not using the command block, so either the problem is with the way I've done my command (cw -o 1031 63 692 /schem load Xebec1, also tried cw /schem load Xebec1, same thing), or in CBWrapper (Or incompatible WE version?)
Amazing plugin, I only have one question: is it possible to disable [CBWrapper] output in console? I mean the "Something tried to send a dummy player the message.." output. It is really annoying :(
Emm I excuse the pm, I didn't see your message "If you comment anywhere other than this page, I probably won't see it for at least a few months" I would really appreciate if you could take a look at your pm :)
Hope to hear from you soon! :)
@misson20000
Thanks for the reply, I know I said "after each offset coord" in my post but I meant before. Your suggestion was the first I tried and I didn't get any errors messages in the console. Do you have any more tips I could try? Thanks again!
@evilhusky5
Could you post the server log on pastebin or something? Both the 1.7.2 version and the latest devbuild both load just fine on my test server running the 1.7.9 CraftBukkit beta version
@GrinningMoon
If you get an error in your server log that looks like
Try putting the squiggles before the numbers like
@bigwill1685
Hm, I just tried running that exact same test on my test server and it worked just fine for me. Try using "-u test" on both of your command blocks?
Hey there, we love this plugin! Its really useful especially in combination with loraxe's movecraft plugin to create automated ships! We ended up encountering a problem though. The plugin is still at 1.7.2 while our server is at 1.7.9. This ended up somehow creating issues the server didn't like and made it through a tandtrum. We uninstalled it and the problem was fixed. We surmised that it was a combatability issue. Seeing as we were planning to have this as a major part of the server we seriously contemplated going back to 1.7.2. We ended up deciding that it would be best to wait for the 1.7.9 release so as to not lose members. I hope the release comes soon though!! :3
Hello Mission4000, thanks for this great plugin!
Since I know if it was me I would like to know the sort of things people were doing with my plugin, I thought I would show you this automated passenger airship ferry I set up using your plugin with Movecraft.
You can check it out here: https://www.youtube.com/watch?v=1w_rem0_fKY
Hi, so I've a problem with using the butcher command (worldedit) with cw. The regular butcher command I use is /butcher 75 -l, this kills any mobs within a radius of 75 and is supposed to spawn a lightning bolt on the spot of their death, but only the thunder sound is heard. This is fine with me, so I tried: "/cw -u test butcher 75 -l" (without the quotes) in a command block attached to a pulse clock and everything works fine. Only problem is I want this command block hidden (for the butcher command to work properly it has to be on level with the mobs you want killed) so I created a command block area near bedrock and tried using the offset tag: "/cw -u test -o 0 75 0 butcher 75 -l". (There are squiggles after each offset coord but they don't show when I post) This kills all the mobs at the proper level but the thunder noise doesn't go off when a mob dies. I know you state to list all the variations of commands you've used but I've tried using every kind of nesting with [,{,(, and just can't get the thunder sound to work.... Please help me
@misson20000
so i'm fairly sure i found out the issue, the game doesn't recognize the fake player as being the same with each command block. i did a test run where i had a command block do /cw /hsphere glass 3 and sure enough a glass sphere appeared around the command block. here is where the problem happened though, i had a command block next to this one with /cw /undo and nothing happened. it couldn't be undone cause nothing was made by that "person". i also tried doing undo and got the error of nothing to undo.
thanks for the quick reply, the command does nothing as before even with the extra / removed. someone has posted before that theirs didn't work with /cw but did with /cb so i tried both and still no dice
@bigwill1685
I should make this more clear in the project description, but WorldEdit commands only need one slash and all other commands use no slashes. I think it's a bit weird, but it's the way Bukkit works.
In your case, I believe that the necessary commands would be
I'm having a bit of trouble using this to add members to a region, anyone ever heard of issues there?
@misson20000
sorry was away for awhile without my computer, i have version 1.7 and the commands i use are as follows /cw /region select dblock /cw replace diamond_block air /cw replace air diamond_block
the command blocks says it outputted these commands and yet nothing happens, i have it set on a button trigger like a lever so after the region is selected if the blocks are there from last time then they will be removed but if they aren't there they will be added. the whole setup works if i type the command as opposed to using the command blocks so i know it's not something like i screwed up the region or whatever.
EDIT: apparently using 2 /'s makes the word italicized so before both replace commands is 2 /'s
This plugin is great! Works like a charm! :D
I'd just like to say I spent that last two days struggling with this plugin not understand how you always seem to be active but your plugin doesnt work, well it turns out you didnt get rid of /cb because its still running /cb spent 2 days trying /cw
@JackzMc
If you use /minecraft:say as an op does it work? Have you tried /say?
@bigwill1685
What version of CBWrapper are you running? Can you post the commands that you're using?
Hey, tried using 3 command blocks in this order, first one selects a region defined by worldedit, second one replaces all diamond blocks with air, and the third one replaces air with diamond blocks. the timing is fine and the command blocks don't give off any errors, in fact they list the command as last thing they did just fine but none of it happens just as it did before i added this to my server. best i can tell nothing has changed.
/cw minecraft:say Hello Test Message does not work, the command is /minecraft:say, and it's the vanilla /say
@pookshuman
I beleive you're using one of the versions of CBWrapper in which the coordinates must be relative and prefixed with a "~" character. You can either figure out the relative coordinates and fix the command, or upgrade to the latest version of CBWrapper where you can use either type of coordinate.
I keep getting this error
10:35:24 PM CONSOLE: WARN]: CommandBlock at (-28,65,5) failed to handle command 10:35:24 PM CONSOLE: exception executing command 'cb' in plugin CBWrapper v1.6 [Bukkit 1.7.2-R0.3] 10:35:24 PM CONSOLE: java.lang.NumberFormatException: For input string: ""
I am trying to execute the command at specific coordinates. The commands I have tried are:
cb -o -12 60 8 /copy
cb -o -12 60 8 -u @ /copy
cb -o -12 60 8 -u myname /copy
What am I doing wrong?
Also, please don't remove the /cb alias.
Thanks