VirtualPlayers2
NOTE: This project has moved to Modrinth. All future updates will be posted there and this page will no longer receive updates.

A plugin that allows you to create virtual players for easy debugging of plugins through console or in-game.
VirtualPlayers is a plugin designed for developers and server admins to easily test and debug plugins that require multiple players. Virtual players are non-existent in-game, and are only accessible through console or chat, meaning they will be invisible on the server list, player count and in-game.
VirtualPlayers will also work with many large Minecraft plugins, such as WorldEdit, allowing you to perform actions that are typically reserved for online players, but through a console. Virtual players can also be managed in-game, or through other command senders, such as command blocks or signs.
Features
- Run commands as a virtual player through console or chat
- Send messages as a virtual player through console or chat
- Teleport a virtual player to a specific location
- Op/de-op a virtual player to test command execution
- Attack a real player as a virtual player to test combat mechanics
Commands
| Command | Description |
|---|---|
| /vp create <name> | Creates a new virtual player. |
| /vp remove <name> | Removes a virtual player. |
| /vp removeall | Removes all virtual players. |
| /vp select <player> | Select a virtual player. |
| /vp observe <player> | Observes a virtual player. |
| /vp unobserve <player> | Unobserves a virtual player. |
| /vp list | Lists virtual players. |
| /vp verbose [player] [true|false] | Toggles verbosity for the virtual player. |
| /vp teleport [player] [location] | Teleports the virtual player to a location. |
| /vp command [player] <command...> | Runs a command as a virtual player. |
| /vp chat [player] <message...> | Sends a chat message as a virtual player. |
| /vp op [player] | Ops the virtual player. |
| /vp deop [player] | De-ops the virtual player. |
| /vp attack [player] <target> [damage] | Attacks another player as this virtual player. |
Permissions
| Permission | Command |
|---|---|
| virtualplayers.command.help | /vp [help] |
| virtualplayers.command.create | /vp create |
| virtualplayers.command.remove | /vp remove |
| virtualplayers.command.removeall | /vp removeall |
| virtualplayers.command.select | /vp select |
| virtualplayers.command.observe | /vp observe |
| virtualplayers.command.unobserve | /vp unobserve |
| virtualplayers.command.list | /vp list |
| virtualplayers.command.verbose | /vp verbose |
| virtualplayers.command.teleport | /vp teleport |
| virtualplayers.command.command | /vp command |
| virtualplayers.command.chat | /vp chat |
| virtualplayers.command.op | /vp op |
| virtualplayers.command.deop | /vp deop |
| virtualplayers.command.attack | /vp attack |
Developer Guide
VirtualPlayers offers an API for developers to use. Please see the Developer Guide for instructions on using the API.
Links
- Website: https://www.battleplugins.org
- Discord: BattlePlugins Discord
- Donate: BattlePlugins Patreon
-
View User Profile
-
Send Message
Posted Nov 26, 2015@Unpluggeddk
thanks for letting me know
-
View User Profile
-
Send Message
Posted Nov 24, 2015Cant place redstone, or anything you want to face a way.
ex /dc bobby bpe redstonetorch:1 test,176,58,334
(facing east)
You cant place redstone, it will just replace an existing block with air.
Cheers :)
-
View User Profile
-
Send Message
Posted Oct 3, 2015Please update to support the latest spigot.
-
View User Profile
-
Send Message
Posted Sep 12, 2015@Europia79
I really encourage you to do this! This plugin is great for testing but it can be even better for redstone freaks, especially with simulation of mob spawning like around real players. Toggle is of course necessary (performance of the server). Though I'm not sure if loaded chunks allow mobs to spawn like real players do. It suerly keeps redstone alive. But I'm no expert.
Than you for your time and motivation.
-
View User Profile
-
Send Message
Posted Sep 11, 2015@UnpleasantPL
i guess i could listen for ChunkUnloadEvent and cancel it if there's a VirutalPlayer at that location... And also add a config option to toggle this feature on/off.
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/world/ChunkUnloadEvent.html
-
View User Profile
-
Send Message
Posted Sep 10, 2015Hello there!
Is there any way to keep mobs and redstone clocks active around fake player the same way they are active around real ones? :-) It would me a neat feature for keeping the villager farms and other complicated machines based on clock alive with chunks fully loaded. It's something I've been waiting for years!
-
View User Profile
-
Send Message
Posted Jul 19, 2015i have a few questions and i found a bug
will there ever a config file is it possible to change the chat format to chat essentails
and when you initiate he chat command, it sends the message twice
-
View User Profile
-
Send Message
Posted Jul 5, 2015@Dysthymical
I read the PVPManager code... In order to fix this, VirtualPlayers would have to inject itself into the CraftServer's playerList field and construct a playerConnection also. I doubt this is going to happen.
Another option would be for PVPManager to add support for VirtualPlayers in one of three ways:
1. For me.NoChance.PvPManager.Managers.PlayerHandler.add()... remove the first conditional statement:
2. Obviously, they do not want to un-necessarily populate their players HashMap, and that is the primary objective of the conditional check. But they don't have to return null... They could still return the created object without saving it to the HashMap. This is probably the best option because it's a more general solution to a variety of problems that arise when you return null.
The code would look something like this
Now it doesn't return null.
3. The third option would be to change the implementation details for the conditional-saving check to account for the existence of VirtualPlayers by hooking into the VirtualPlayers API.
Obviously, you wouldn't directly call VirtualPlayers.getPlayer() because it might not be installed on the server... But that's just an example. They would have hide the call via a Wrapper, Interface, or Utility to protect against ClassNotFoundException.
https://github.com/NoChanceSD/PvPManager/issues/41
https://github.com/NoChanceSD/PvPManager/pull/42
As far as Skript goes... That error is caused by PVPManager, not Skript. But if you have any other problems, lemme know and i'll take a look.
-
View User Profile
-
Send Message
Posted Jul 4, 2015Can you add support for Skript and PVPManager? I get these spammed into console about every 30 seconds http://pastebin.com/snF6nL3w
-
View User Profile
-
Send Message
Posted Jun 28, 2015@fr233
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 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/commits/vpcmdfix
https://github.com/Europia79/WorldEdit/commit/eb43018ae2211b4257e418209fef1b922a03cf91
-
View User Profile
-
Send Message
Posted Jun 25, 2015how to paste schematics use this plugin?
-
View User Profile
-
Send Message
Posted Jun 17, 2015@LaughNgamez
Yeah, VirtualPlayers v1.6.5 for 1.8.7 needs approval from BukkitDev.
Development builds of this project can be acquired at the provided web-server.
These builds have not been approved by the BukkitDev staff. Use them at your own risk.
http://rainbowcraft.sytes.net/download/plugins/VirtualPlayers2/v1.6.5/
-
View User Profile
-
Send Message
Posted Jun 17, 2015@Europia79 Would you please post a compiled build of the plugin to support 1.8.7 or is bukkit processing your request?
-
View User Profile
-
Send Message
Posted Jun 17, 2015@jaime29010
v1.6.5 is updated for 1.8.7
@Jeffrey09
The code is pretty insane: https://github.com/Europia79/VirtualPlayers/tree/worldedit
That's the worldedit branch for VirtualPlayers (in case you wanted to find a developer to finish it). You would have to fix all the errors associated with the fake PlayerConnection. Then after that, you'd have to accommodate for VirtualPlayer being a real Player (the easy part).
-
View User Profile
-
Send Message
Posted Jun 12, 2015@jaime29010
There shouldn't be any stacktrace... VirtualPlayers disables itself on server startup for unsupported servers... to prevent spamming the console with errors. Instead, you'll get a msg explaining that your server is un-supported.
I'm in the middle of updating BattleTracker right now... Hopefully, I can get to VirtualPlayers soon tho.
-
View User Profile
-
Send Message
Posted Jun 10, 2015I like your plugin but using the lastest version (1.8.7) doesnt work, the nms classes have changed so yeah, it doesnt work, I think I dont need to put a stack trace in this situation.
-
View User Profile
-
Send Message
Posted Mar 29, 2015@Europia79
I used your plugin in a similar way with schematics and now that I've come back to mc I would like to again. My problem is though that I can't backdate to WG 5.x so an update that fixes this would be nice.
-
View User Profile
-
Send Message
Posted Mar 28, 2015@amli2011
LaughNgamez reported the same problem... I believe this feature works if you use WorldEdit v5.x... it just doesn't work if you use WorldEdit v6.0.0
WorldEdit has changed something in the code to break this feature. So either WorldEdit would have to change to allow fake players to run commands... Or else VirtualPlayers will have to somehow change to better simulate a real player... but HOW exactly, i do not know.
-
View User Profile
-
Send Message
Posted Mar 28, 2015Thank you for the update!
I downloaded it and have tested a bit.
When i try to use a virtualplayer to execute WorldEdit commands schem load and paste it vil tell me that my clipboard is empty.
This might be that worldedit is not comfortable with virtual player...
First now I'll try your latest update and I'll search arounf a little more.
Again Thank you for the update :)
-
View User Profile
-
Send Message
Posted Mar 22, 2015@Europia79
Thanks for your response. I just tried the latest dev build of Multiverse-Core (which was also suggested by someone else in the bukkit forums), but sadly it doesn't keep the dimension loaded without players - overworld-spawnchunks still go inactive the moment the last player leaves the overworld. Thought, keepSpawnInMemory: 'true' or autoLoad: 'true' might be the key there, but unfortunately they are not.