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

VersionSource Link
Development Versionhttps://github.com/misson20000/CBWrapper
Version 1.8.3 (current)https://github.com/misson20000/CBWrapper/tree/v1.8.3
Version 1.8https://github.com/misson20000/CBWrapper/tree/v1.8
Version 1.8_alphahttps://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


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files

Bukkit