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
Working with BungeeCords ?
The player are shown in the tab list ?
@alkarinv
Sorry, got distracted and kinda forgot lol, but /VP Help would just show all the possible commands, this way I don't have to come back to this page to remember what commands there are, and the only reason I'm asking about potion effects, is because I was hoping to use this plugin to help test Infected, and in order to do that I need to add potion effects
@Bimmr
Hey sniper, what would vp help do? just list the commands?
And I'll try for the potion effects, could be interesting though.
Is there a chance you can add "/VP Help" and support for Potion Effects for the virtual players?
no permissions? i will use it only as owner and not other users.
@GeekWithAChick
Thanks! and check out the command /virtualplayers hideMessages.
Let me know if that isn't enough.
Can you add a command to disable the logs to the console? It's spamming :(
Keep This Up! It's amazing and really useful!
Awesome, will be very useful to debug.
@Siriusic
Still no sign on an update though D:
Awesome, it's not inactive! :D
http://pastebin.com/ybj2MxWB
Will an update for 1.7 be coming any time soon? :)
I'm trying to use commands with my dummy player (the virtual one) but the commands aren't executed. The console says (example)
"Executing "/randomcommand" for player "playername"
Command cancelled: "/randomcommand"
Help? Also, maybe instead of virtual players you can make them just appear somewhere on the server to execute commands, and to show up on the server list, becuase is not compatible with some things D:
UPDATE
I submitted a pull request on the repository on Github. Hopefully it gets merged soon.
Wondefrul Plugin, help alot but i found a few bugs
I have a sign @ location "lobby,-75,92,38" with Line 1s text saying "[Map]"
When i tried to do the interact event with command "/dc p1 interact right lobby,-75,92,38" It says "p1 RIGHT_CLICK_AIR AIR with a AIR"
So, then i tried placing a block there with the command "dc p1 dpe GLOWSTONE lobby,-75,92,38" and the block was placed NEXT to the sign.
I then increased the x value by -1 so instead of -75 its now -76 and it worked like a charm.
So, that determined that the x value with your getLocation & parseLocation are 1 off.
I also tried interacting with things without the world name and it ALWAYS gave me a "Location __ was not found
Maybe we could add the option to make your server player count look higher when you have a couple vps on the field. The names could show up in the tab list, and the number of players that you see on the server list screen right before joining, could be completely configurable in itself. It could be set to show a total number of players on the server based on the player and vp count. Or we could set it to a predefined number with a command or in the config. maybe even set it to change every few minutes? just ideas. I love the potential though. All of this could be optional, of course.
Once again Great plugin, i always enjoy your work!
@alkarinv
so just download the latest one for 1.6.2? Thanks in advance!
@LaughNgamez
I just updated right now. VirtualPlayers 1.5.2. It will say its only for 1.6.2 (but thats only b/c the 1.6.4 option isn't available yet).
Please update for 1.6.4
Looks like this will come in handy when making my own plugins. Hopefully.