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
mission20000,
I love your plugin and had been using it for the generation of structures via console commands for quite some time. When I heard you updated it, I was overjoyed! However, here's the kicker, I'm using Cauldron (version 1236). Let me say I realize Cauldron is way beyond its 'end of life' period but I'm too far invested in the build of my server or the integration of other plugins to be able to switch. Besides, Forge has very limited server admin support and Sponge is still a ways off. I've been lucky in that most updated bukkit plugins still run well.
Anyways, back to my point, would you please consider reverse compatibility for Cauldron? I'm sure I'm not alone in staying with Cauldron and others could benefit from any of your efforts to offer compatibility. Thank you!
I'm getting the below error in anything I attempt:
[12:38:40] [Server thread/WARN] [Minecraft/]: Unexpected exception while parsing console command "cw -w Overworld -o 0 105 0 -u test /pos2" org.bukkit.command.CommandException: Unhandled exception executing command 'cw' in plugin CBWrapper v1.8_alpha at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) [PluginCommand.class:git-Cauldron-MCPC-Plus-1.7.10-1.1236.06.212] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) [SimpleCommandMap.class:git-Cauldron-MCPC-Plus-1.7.10-1.1236.06.212] at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:717) [CraftServer.class:git-Cauldron-MCPC-Plus-1.7.10-1.1236.06.212] at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(CraftServer.java:697) [CraftServer.class:git-Cauldron-MCPC-Plus-1.7.10-1.1236.06.212] at net.minecraft.server.dedicated.DedicatedServer.func_71333_ah(DedicatedServer.java:465) [lt.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:424) [lt.class:?] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:798) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:658) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_25] Caused by: java.lang.NoClassDefFoundError: misson20000/plugins/cbwrapper/DummyPlayer at misson20000.plugins.cbwrapper.CBWrapper.onCommand(CBWrapper.java:117) [?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [PluginCommand.class:git-Cauldron-MCPC-Plus-1.7.10-1.1236.06.212] ... 8 more
After stopping and restarting my server, everything works again, and my FakePlayers are no longer visible in-game. No problems to report here... :)
@misson20000
That is correct. They show up in my Tab-List and I can actually see a player with @ as its name in-game. I created a fake player called SysAdmin for my command blocks because not specifying a name wasn't working. This SysAdmin changed worlds somehow, and I can even TP to this SysAdmin as if it was an actual player.
@jjkrause
You can actually see them in-game? Like, see a player named "@" standing in your command blocks?
It was working fine for me but my FakePlayer somehow got teleported to another world. I modified my 3 command blocks to the following instead:
/cw -w tetris -o 7 140 -7 /pos1
/cw -w tetris -o -8 65 8 /pos2
/cw -w tetris /set air
First command sets POS1 in world Tetris. Second command sets POS2 in world Tetris. Third command sets all blocks in selection to air.
This should work, correct? For me, its not doing anything... What am I doing wrong?
Works great again. Thanks!
Making the fake players not visible on the Tab list or visible in-game would make this plugin perfect... :)
@Dragon_12dk
I'll go get to work on that. There's a way, but it's something I have to add to my plugin
Great update :) it's working again! Is there a way that you know of where I can hide the new @ player from my server tab list? My players keep trying to talk to him :P
@Zillew
Posted out a status update, finally figured out what I need to fix last night. My goal is to have builds out by March 1st, but I can't promise anything
Any updates on the whole 1.8 situation?
Thanks!
looks like the perfect plugin to temporary turn off build permissions within a region without type a long command in the chat over and over again. I am really hoping you figure out how to solve the problem! i wish you much luck!
I see you have made a status update on 1.8.... I wish you good luck! looks complicated
Any news about a 1.8 build?
I'm running a git-Spigot-1.7.9-R0.2-208-ge0f2e95 server, with Carbon and Protocollib plugins and play with the 1.8 minecraft client. It's possible to work CBWrapper with this configuration?
I put: /cw say hello in a command block, but world edit commands seems not working.
Looking forward for the 1.8 update! :) Cant wait! Keep up the good work!
Ok, getting an error when trying to load/paste a schematic with:
1.8 and WE 6.0.2 [build: 3353] - http://builds.enginehub.org/ - (latest dev build) which is needed for text to be on signs in schematics.
Error: http://pastebin.com/YM5B5AdP
The maker of worldedit looked at it and said:
FYI: if you go into the world edit IRC chat he is normally on at night and will prolly help you with anything you need to know about worldedit.
The errors you guys are getting are because A: I haven't updated the plugin for 1.8 yet, and this plugin is very sensitive to Bukkit updates B: WorldEdit changed the way it keeps track of sessions. It's taking me a while to figure out how it works now, but once I get that sorted out everything should be fine
I get those errors too, so it shuld be pretty easy for me to debug
I'm trying to use world edit with cbwrapper. I want to replace an entire section of blocks with grass blocks instead. And on another command block I would like to cut the pace above the section of blocks so nothing is there...and on ANOTHER command block i want to spawn tree's (a forest) in that section. This way I can make another system but for a desert biome and not a forest one...so when i replace the grass with sand...the tress are cut...and cactus is spawned.
However, all I need is the commands to:
turn a section of blocks into grass
and create a forest on the section
Anyone know how? because im new to using world edit on cbwrapper. Please help
Yeah me too, I have the same error as Zillew. It's a big problem for my server because we use a lot this plugin
would love an update for 1.8 http://www.spigotmc.org/threads/bukkit-craftbukkit-spigot-1-8.36598/