VirtualPlayers
VirtualPlayers
This is a lightweight plugin for 1) debugging plugins or 2) doing commands for plugins that need players.
The virtualPlayers can take actions via commands and print out the events that are happening to them on the console. These players don't show up in game, but are just used for performing actions as if a player was there. Very useful if you don't even want to load up Minecraft, you just boot the server and debug as if you were players without even running the game.
The virtual players respond to the following commands.
Commands as Players
Commands: dc = do command, <virtual player> = the name of virtual player
- dc <virtual player> any command you would normally do as a player
- dc <virtual player> op : op virtual player
- dc <virtual player> deop : deop virtual player
- dc <virtual player> respawn : respawn the virtual player
- dc <virtual player> disconnect
- dc <virtual player> connect
- dc <virtual player> reconnect
- dc <virtual player> health <amount> : give the virtual player some health ( or kill them if 0 )
- dc <virtual player> inv : print out their inventory
- dc <virtual player> giveinv <item> : give them an item
- dc <virtual player> tp <location> : teleport them to the given location ( "world,3,3,3" )
- dc <virtual player> chat my message : have the virtual player talk in chat
- dc <virtual player> hit <player2> [damage] : attack other players, defaults to 5 damage
- dc <virtual player> interact <left | right> <location> : do a PlayerInteractEvent on the specified block location
- /dc <virtual player> bpe <block> <location> : do a BlockPlaceEvent of the given material at the given location
- /dc <virtual player> bbe <location> : do a BlockBreakEvent at the given location
Other Commands
- /virtualplayers hideMessages : hide messages from players
- /virtualplayers showMessages : show messages from players
Examples:
- dc p1 spawn
- dc p2 disconnect
- dc p1 chat Hello Server!
- dc p3 bpe iron_block world,310,65,700 : Place an iron_block at world,310,65,700
hideMessages
Virtual Players will print out to the console if they teleport, receive a message or tell, respawn, connect/reconnect
I usually have a text file where I type out the commands I want to do with the players then just paste all of the actions into the console
@LanToaster
I started putting it in, but got sidetracked on another project. It will be up in the next few days though!
It would be very Cool if you could Implement BlockPlace events. That would be a Great Way to Toggle RedStone Circuits per Console.
If it doesnt Derail your Plugin to much. (I for myself Love to derail Plugins for more Purposes )
@LanToaster
I have a place holder for a blockplace event.. but I never implemented it ( i had no reason to a t the time). I can put in commands to make them place and remove blocks if you would like (they would actually work, trust me).
As for the errors, if a plugin tries to access virtualplayers through craftbukkit ( some of the more advanced/complicated plugins do this) sometimes it will throw errors for that plugin. Usually this is not a big issue, the plugin just catches the error and keeps going. NoLagg is probably doing something internally that is beyond the scope of normal bukkit plugins, probably no big deal.
Hmm, i tested a little bit, if it could really do what I need. But it doesnt seem as it would Really perform the Commands. As i Tested to let the Virtual Player Change a Block to Sand via WorldEdit it just told in the Console it Changed the Block. But not really Ingame.
To verify if i selected the Right spot, I even Teleported to the Virtual Player (wich worked). But the command still showed no effect.
BUT, i also got an Error from NoLagg when i first Teleported the VP:
@coaster4321
Tell me what you would like them to be able to do. Break blocks? place blocks?
They already can interact with blocks by left or right clicking them.
This will help my development so fucking much. Thankyou so much man!
Can you get it if it does not have it yet (have not tried it yet) Npcs like actual players on map to minipulate. If Its there just ignore this request. I am unable to actual install on my test server at the moment i am not home :D
Great work!!
@cadika_orade
yep!
Make sure you deop them first. By default they come in as ops.
:O This is simply perfect! Now I can debug my permissions configs without needing someone to sit there for an hour while I keep reloading the server! xD
That is great, with this I can create my SkyBlock World without an extra Plugin :) I love Utility Plugins like yours.
@LanToaster
You could. Though many of the worldedit/worldguard commands need a "selection" which would be a bit tricky with the virtualplayers.. You would have to give them a wood_axe, have them interact with the first block, then interact with the 2nd block with a right click. (1.2.5 allows left and right clicks).
But I often do commands as players to avoid going in game. (though I usually don't run VirtualPlayers on a live server, I use it more for just testing)
Am I seeing this Right, that i could Use this Plugin to trick some Plugins wich dont like Console Commands that I run the command as Player? (E.g. WorldGuard / WorldEdit)
@sync667
I had the default virtual players starting at "world". So servers without this would have issues. This is fixed now.
New version up. 1.2.4
It's possible to edit player account already but the people who usually do it are those who host lame servers or just want to spoof it for some voting website.
@matthew1235100
Hey Matthew, it's a nice offer, but what you're asking I'm not even sure is possible. If it was possible it would require modifying things at a very low level to make it show players as online that don't exist.
Basically it's just not a project I'm interested in right now, with or without money :)
You Going To Anser Me????!?!?!?!?!??!?
@alkarinv
If You Did Make a plugin or Show Me How To I Would Pay You For It.
@matthew1235100
Its just not what they were designed for. Primarily though, There's some legit reasons to do it, but there are a lot of people that would abuse the extra player count.
@alkarinv Why Not?
@matthew1235100
Heh ;) I won't be adding the ability to affect player counts... actually I don't even know how and don't plan to learn :)