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
I can only use the plugin on World Edit but other commands won't work. When I did /cb /spawnmob Chicken 1 it says "Someone tried to send a dummy player a message" Unknown command Type /help for help
when will 1.7.2+ come out?
Ehi, really thanks for this plugin. I'm building lots of daily events, fully automatics, And they run without any order! No more work for staff :D
@dnbESTgaming
Does it say anything in the console? I might have to look in to that...
@misson20000
Well, for some reason, it still doesn't remove the arrows on my minigame...
@dnbESTgaming
If you put /cb CBWrapper /remove projectiles 100, that will try to run "/CBWrapper /remove projectiles 100", instead of "/remove projectiles 100". Just take out the CBWrapper part so that it looks like
How can i use this to remove arrows from my minigame? I made a minigame, searched for worldedit usage with commandblocks and found that, but i can't seem to figure out how to use this, because /cb CBWrapper /remove projectiles 100 doesn't work for some reason..
01.11 20:29:11 [Server] INFO Something tried to send a dummy player the message 'Unknown command. Type "/help" for help.' appears to console also..
@pookshuman
Yeah, I was thinking about that. I like them for when I'm debugging my commands, but I don't like them when things are working and it clutters the console. Maybe I could add a flag to the /cb command to display messages in the console. But if you want messages, you can download CBWrapper 1.4 with messages. Here's the link. The one without messages isn't updated or anything. It's exactly the same, except for the messages.
just my 2 cents, but I like the messages that something happened. Otherwise I have no way of knowing if the thing is working correctly.
Maybe you could add a commandline option for it?
/cb messages on
/cb messages off
edit: either way though, awesome plugin ... keep up the good work :)
@rcHELIguy
Okay, I went and compiled it. It's an Alpha build, so it won't show up for the download link, but you should be able to see it under the Files tab once it goes through the approval process
I will absolutely donate a nice chunk of change after you remove the "Something tried to send the Dummy player a message" in the console.
Could you possibly compile a version that does not have the console message "Something tried to send the dummy player a message" This happens with every WorldEdit call. It fills up the console.
Thanks for such a nice plugin! Removing this would be a great change. An option to turn on or off would be great.
This is my version for 1.6.4 (tested) The -u parameter doesn't work anymore To use custom names rename the commandblock in a anvil
Download (Via own host) http://ndat.nl/f/1381168234_OTF.jar
I do not give support
Hello, can you please consider changing the command to /cbw or something else? The mod ceases to work completely when you have Craftbook installed, because craftbook uses /cb already. Or can you instruct me how to change the command myself?
Doesn't seem to work with /forestgen or am i doing something wrong? Im trying to make it auto regen a forest for a tree farm.
* Got it to work I need to take the / out...works like a charm. Thanks for this plugin
Oh, also. There's a beta build of 1.6.2 bukkit out. Just so you know. (;
I have a feature request. I would really appreciate it if an optional parameter was added for the dummy player's position, which would allow automatic area regen using WorldEdit.
@TCGM
Thank you for that, I was having trouble before I saw your comment!
For those of you trying to figure out how to use this on 1.6.1 and 1.6.2, make sure you are an opped admin on your server, and rename the command block to your name via an anvil. Works perfectly fine afterwards.
@Evilcerber
You set up a command block as you usually would (name it if you want to run as a dummy player with a specific name).
Open the command block interface, type in
Whenever you power the commandblock, it will run the command after the /cb as a dummy player (with the specified username if you set one)