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
@amli2011
i'll try to update VirtualPlayers this week. Thanks for letting me know about a new Minecraft update for 1.8.3
@ceagle2
i think one of the plugins on my server keeps chunks loaded. I'm guessing it's Multiverse-Core, but i could be wrong ? Until I get a chance to look into it, i would try Multiverse-Core, login just once, logout, and see if that works.
@Europia79
I'm doing as much as possible with CommandBlocks in order not to become too dependent on plugins which authors tend to abandon far too often for my taste - this for example also includes a random loot chest, each player should be able to use once per day. This makes a daily reset necessary, which I do this way: a cronjob sends a certain setblock-command to console to place a redstone block somewhere to remove and re-add an objective for that random loot chest. The whole mechanism resides in overworld spawnchunks. But the reset won't do a thing if there's no player in the overworld when the cronjob-reset-setblock-thingy happens. Already thinking about making a PHP-script to do that sort of resets in an endless loop until the rcon response says that it worked.
Also a lot of other stuff with /trigger commands which require overworld CommandBlocks to do their job - which they don't, if for example there is only one player online and he's in the nether. Then I'd have to copy all of that into the nether spawnchunks, which btw don't load if the first one to enter the nether enters it far away from spawnchunks - but once they're loaded, they stay loaded even if that one person moves far away from them, until he leaves the nether.
Problem there is: commandblocks or rather selectors don't differentiate between worlds anymore, so if nether AND overworld are both active, both commandblock-centers would do the same thing and interrupt each other due to differences in their timing. So I can only have such a commandblock-center in one world to do its work for players in every world, and thus I require the spawnchunks of this one world to stay loaded permanently even without players.
I did try Citizens, but it doesn't keep anything loaded. Other than that, I try to keep the amount of plugins as low as possible - right now it looks like this:
Absolutely necessary: GriefPrevention, ChunkLoader (for Nether and Endworld spawnchunks, which behave weird in some cases, as explained above)
Optional plugins, could live without: BetterAlias, ChunkLoader, CoreProtect, Dynmap-GriefPrevention, EntityWatch, HideStream, MuteManager, NoCheatPlus, OpenInv, VanishNoPacket, Votifier, bPermissions, dynmap, pTweaks, quickcuboid
I have also tried about any plugin I could find to keep chunks loaded, but none of them managed to do that without players in that particular world. That's why I'm hoping that players can somehow be 100% simulated - which methods are triggered when a player joins a server? Can they be triggered to simulate exactly that and to load a dimension without real players?
When starting my server i get this in my console: [VirtualPlayers] The maximum supported version is 1.8-R0.9-SNAPSHOT
My server is 1.8.3.
Is there an update in near future?
I havent tried your plugin before. Is there suport for permissions in the plugin?
Thank you!
@ceagle2
Why do you want to keep certain chunks loaded ? (just curious) What plugins are you using ? Have you tried Citizens ?
Since players are required to keep dimensions loaded (which also means, ie. overworld spawnchunks get unloaded once there are no more players in the overworld), can this plugin in any way be used to simulate a real player in a way that a dimension (and thus its spawnchunks) stays loaded without real players in it? My first few tests seem to say no, but maybe you have an idea there. :)
Possibly link to the new source code? https://github.com/Europia79/VirtualPlayers
Seems like /virtualplayers hidemessages still shows the messages in console, can this be fixed?
@Europia79
Okay, I'm not in a giant rush as I can still test my plugin without this.
@Bimmr
A VirtualPlayer needs a PlayerConnection to handle packets. eueln has a Pull Request on github for this issue.
I'll look into it when I get time.
@Europia79
I'm just using the player.addPotionEffect(...), I'll check if the error still happens, but I am running a test server with Spigot 1.7.10, and not Spigot 1.8(In case that may mess it up).
Edit: Ya, it still happens... Although on the bright side it doesn't stop the plugin anymore lol http://dev.bukkit.org/paste/11131/
@Bimmr
Sorry, i didn't get an email response (like usual) that you commented. I'll look into it.
What commands are you using to give potion effects ?
One issue i remember from the old version was that the plugin didn't like it when the virtual players were given potion effects, would you be able to add support for that, if its not there already.
@LaughNgamez
okay, i just uploaded an update for 1.8
it's VirtualPlayers2 version 1.6.1
@LaughNgamez
VirtualPlayers is up to date.
https://github.com/Europia79/VirtualPlayers/issues/new
if you need to report a bug or request a new feature, just create a new ticket.
Please keep updating this :) !
Hello everyone, this is a console plugin used by Admins, Developers, and Testers...
There are no permissions for the VirtualPlayers plugin.