VirtualPlayers2
VirtualPlayers
This is a lightweight plugin for 1) debugging plugins or 2) doing commands for plugins that need players.
The virtual players 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, <vp> = the name of virtual player
- dc <vp> <cmd>
- dc <vp> <any command you would normally do as a player>
- dc <vp> op : op virtual player
- dc <vp> deop : deop virtual player
- dc <vp> respawn : respawn the virtual player
- dc <vp> connect
- dc <vp> disconnect
- dc <vp> reconnect
- dc <vp> health <amount> : give the virtual player some health ( or kill them if 0 )
- dc <vp> inv : print out their inventory
- dc <vp> giveinv <item> : give them an item
- dc <vp> tp <location> : teleport them to the given location ( "world,3,3,3" )
- dc <vp> chat my message : have the virtual player talk in chat
- dc <vp> hit <player2> [damage] : attack other players, defaults to 5 damage
- dc <vp> interact <left | right> <location> : do a PlayerInteractEvent on the specified block location
- dc <vp> bpe <block> <location> : do a BlockPlaceEvent of the given material at the given location
- dc <vp> 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 p1 chat Hello Server!
- dc p1 bpe iron_block world,311,75,400 : Place an iron_block at world,311,75,400
Virtual Players will print out to the console if they teleport, speak, receive a message, 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
Source
Credits
VirtualPlayers was originally developed by alkarinv. All credits for the original plugin goes to him. :)
WorldEdit Compatibility
VirtualPlayers2 is fully compatible with WorldEdit v5.x but unfortunately, it is NOT compatible with WorldEdit v6.x. However if you're running WorldEdit v7.x (1.13+), you have nothing to worry about. But if you're still using v6.x, there is a special version of WorldEdit v6 that works with VirtualPlayers:
Quote:These builds have not been approved by the BukkitDev staff. Use them at your own risk. http://rainbowcraft.sytes.net/download/plugins/WorldEdit/v6.1.1-SNAPSHOT/
If anyone wants to use VirtualPlayers to execute WorldEdit & WorldGuard commands, then you can download the above WorldEdit. Or you can use any v5.x or v7.x version.
Here is the source code (& changes) if you wish to compile it yourself:
https://github.com/Europia79/WorldEdit/tree/vpcmdfix
https://github.com/Europia79/WorldEdit/commit/eb43018ae2211b4257e418209fef1b922a03cf91
trying to run /dc in command blocks returns "you need to be op to run this command". :o
This plugin is exactly what I was looking for to be able to run player-only commands at a distance from the player. I was able to teleport a virtualplayer to a coordinate and have it run a player-only command for the player to observe what is happening.
Great plugin! Thank you so much!
Works well on Spigot, and very good to test my plugins without having to start Minecraft!
Hello Kalashnikov79,
sadly, the 1.13 link is down. And are there plans for a 1.14 version?
In reply to MattiBorchers:
The repository it used to be hosted on is currently down. Please join the BattlePlugins Discord if you wish to recieve a jar (latest version supports both 1.13 and 1.14): https://discord.gg/tMVPVJf.
Alternatively, you can compile it yourself here:
https://github.com/BattlePlugins/VirtualPlayers
(Just know, these builds have not been approved by the BukkitDev staff. Use them at your own risk.)
Here's a quick update for Minecraft 1.13:
Still have to do some testing before I release it on BukkitDev.
So lemme know if there are any issues.
Updated for both 1.11 and 1.12
@Europia79 Have you totally abandoned the plugin or you'll continue it? I think this is great project, and there are no other plugins like this!
In reply to Forge_User_54865192:
In reply to overdraft015:
In reply to Forge_User_54865192:
compiler errors. Then use maven to build.
plase not fuction for 1.9.4 all error no list user in the list and online not found? plase update thanks xD
Great plugin!
Do the virtual players show up in the player list? Also are the counted as players in the online players in the servers lists? (I mean if a have 5 virtual players an zero real players, will the number be shown as 5/100, 5 players of a total of 100?)
Thanks
In reply to resoluciones:
In reply to Europia79:
I'm planning to create a skript script that uses this to rebuild a minigame arena.
Hey!
Plugin is great but it does not work on version 1.9. Could you update it?
I really care. Thanks.
Hi is it possible to take control of the virtual player and have him place a sign and edit it ? I can place any block but when i want to make the vp place a sign, the sign doesn't appear
thanks
@LaughNgamez
oh... thanks for reminding me man !!! i made a section called WorldEdit Compatibility for all the information (easy to find than a buried comment).
@Unpluggeddk
The easiest solution is to delete 2 lines of code from WorldEdit... The next easiest solution is for VirtualPlayers to provide an API that WorldEdit can use. However, modifying only the VirtualPlayers codebase to be compatible with WorldEdit is not an easy task. You have to inject the VirtualPlayer into the server's playerList... that's the easy part. Then you have to modify the entire logic of the VirtualPlayers plugin because since they're inside the server's playerList, they will be consider REAL, not virtual. This step is intermediate difficulty... not too hard... just time consuming. The hard part is giving the VirtualPlayer a PlayerConnection object in order to fix all the errors that you'll get.
@Unpluggeddk
You have to use old World Edit or a build posted in the comments of this post.
@Europia79
Np....
Btw mate, did you find a solution for using virtual players with worldedit?
like: