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
@stevo5800
So I purposefully don't do add them into the online list. I don't want people to spoof their online player counts.
Would it be possible to have this show up in the online players list?
@danthegoodman
So, you're trying to teleport to a player in the console eh? Huh... you need to be IN-GAME
@danthegoodman
So on purpose I've kept virtualplayers out of the online players list. So you won't be able to tp to them through a command.
What are you trying to do though? maybe I can help figure out another way.
Hey, when i try to tp to a virtual player, in the console when i put in the command to accept, i get error: null , what does that mean and how do i make it work?
@bands96
I'll change it up and make it vdc with the alias dc.
@Tonilanda
So VirtualPlayers don't add themselves to the online list (on purpose), that means they can't be seen by other plugins when they just try to search for them. Other plugins only interact with them through Events.
Basically what I'm saying is that modreq might not be able to find that player, so the command might not work. Its the same with xAuth, though with that I'll try to find some workaround.
I also encountered some bugs. First of all, commands with wildspaces seem to fail sometimes. For example:
/dc test modreq this is a test
fails.
This can also happen because the player isn't connected to the game and can probably be a problem of modreq. so I tried to log the player in, by typing /dc test connect
But this commando crashes with xAuth, since xAuth can't create a profile for it. I don't know where the problem is, but maybe you can take a look at it.
Thanks in advance.
command /dc conflict with GriefPrevention !
@alkarinv
Just as a tip... You may wish to change the commands... The root command for disguisecraft is /dc... this may cause issues for most servers being that disguisecraft is so popular!
very cool plugin, hope the updates continue :P
@1337minecrafer
Well VirtualPlayers works for me all the way up to 1.4.7, I bet its some plugin conflict but its very strange for sure.
@alkarinv
Yeah, I know. But for some reason, the plugin just stopped working on me... Don't know what I did, don't know how it happened. It just stopped working.
@MazQuick
What version of craftbukkit are you running?
if the command is being cancelled it's some other plugin that is doing it probably.
@1337minecrafer
Heh, yeah. All virtual. If you want NPC's then Citizens is pretty good, you should try that.
I can't do anything with the vPlayer.
Everytime I try to run a command it says Command cancelled. Even if I op the vPlayer. Spawning/respawning him doesn't help either.
So... I guess update required or I can't understand how should I use it.
I fail to see how this works. I cannot spawn this virtual player, nor do anything with it.
EDIT: I thought it would spawn an NPC, but it's 'virtual'. /facepalm
@Mhjort
You are quick to update!
Version for 1.4.7 is now up. Remember that VirtualPlayers only works with specific builds due to a craftbukkit change a while back.
http://dev.bukkit.org/media/files/665/699/VirtualPlayers.jar
This hasn't cleared bukkit yet, but it's there if you need.
Getting an error with the lastest Beta build of craftbukkit, #2602 1.4.7-R0.1
@lzravanger
Wow, it's actually finding them? Can you pastebin me the error, I'll see if I can find a way to stop it.
TagAPI is throwing an error when trying to send a packet to the virtual players.
@Blamo27
I'll see if that is something I can work around.