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
@alkarinv
with 1.3.1 i don't have problems when i start the server, but only with the latest version.
im on:
05:59:24 [INFO] This server is running CraftBukkit version git-Bukkit-1.4.5-R0.2-b2488jnks (MC: 1.4.5) (Implementing API version 1.4.5-R0.2)
I have a server with 150 online player so I know if I have the same file in the plugin folder..however..this is..
@bugeye999
what command are you typing from the command line? I almost always use it from the command line... in fact I usually just copy like 30 commands at once and paste them in. try "dc p1 status" and tell me what that says.
@Anglican333
That's a bit trickier, I purposefully don't add them to the server online player list to prevent abuse. When testing my own plugins I do this, I have a separate Utility file for finding/getting players.
https://github.com/alkarinv/BattleArena/blob/master/src/mc/alk/arena/util/ServerUtil.java
So I basically turn on debugging for virtualplayers, then whenenver I use ServerUtil.findPlayer I will get back both normal players and virtual.
Not ideal, but as I said, I'm stuck with not being able to force them to be online
Is it possible to perform an action on a virtual player. Eg, I'm developing a personal Economy plugin, am I able to do /pay <virtual player>?
I recently installed this plugin, but I have a problem. I am unable to use dc from the command line. Every time I get the error:
[INFO] you need more commands
The plugin works fine when I perform the command in-game, but I need to be able to do this in the command line. Any help would be appreciated, thanks!
@alkarinv
focus on the finals, Spout needs some more time but it will be worth it.
@garan2314
DisguiseCraft doesn't work with these? That's pretty surprising. Not much I can do about it though unfortunately :(
@levisn1
So make sure you only have 1 version of VirtualPlayers installed, and make sure it's the right version. It looks like you have 1.4.5 so use the most recent VirtualPlayers. I'll be trying to abstract that in the future so that the most recent version will always be backwards compatible, but that will be a next improvement.
DisguiseCraft's commands doesn't allow me to use these commands...
@levisn1
-facepalm- seriously? he told you the answer
You have multiple copy's of VirtualPlayers installed. Stop your server then go to your plugins folder and delete all of the VirtualPlayer Jar Files, then install the most current version.
This server is running CraftBukkit version git-Bukkit-1.4.5-R0.2-b2488jnks (MC: 1.4.5) (Implementing API version 1.4.5-R0.2)
i use the beta version 2488 so what i have to do? lol
@levisn1
First it looks like you have a lot of plugins named VirtualPlayers... you area already on 8!!
But welcome to the new CraftBukkit, where a lot of plugins are now "versioned". So what version of Craftbukkit do you have? If you have less than 1.4.5 you will need to download a VirtualPlayers.jar that works with that release.
2012-12-12 05:50:29 [SEVERE] Could not load 'plugins/VirtualPlayers(8).jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException java.lang.NoClassDefFoundError net/minecraft/server/v1_4_5/World
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:154)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:227)
at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:205)
at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:51)
at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:398)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:856)
Caused by: java.lang.NoClassDefFoundError net/minecraft/server/v1_4_5/World
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:143)
... 9 more
Caused by: java.lang.ClassNotFoundException net.minecraft.server.v1_4_5.World
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:34)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 12 more
This happend with the 1.3.3
This server is running CraftBukkit version git-Bukkit-1.4.5-R0.2-b2488jnks (MC: 1.4.5) (Implementing API version 1.4.5-R0.2)
@DonRedhorse
I'm still in the midst of finals, will look more closely once I'm done with them!
@alkarinv
I hope you do...
@alkarinv
Hi... iirc I did send you a PM, can't find it in my PM box though.
Are you going to code it also for spout?
I really like it, helped my troubleshoot some issues I had.
well just noticed that I posted in here already and that you replied, I'm looking forward to this, so I don't need to implement the code myself :-)
@levisn1
Maybe I uploaded the wrong version. Try this one.
http://dev.bukkit.org/media/files/656/58/VirtualPlayers.jar
With the last version, im on 1.4.5 r0.2, i have this when my server start
2012-12-11 04:34:09 [SEVERE] Could not load 'plugins/VirtualPlayers.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException java.lang.NoClassDefFoundError net/minecraft/server/v1_4_5/Entity
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:154)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:227)
at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:205)
at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:51)
at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:398)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:856)
Caused by: java.lang.NoClassDefFoundError net/minecraft/server/v1_4_5/Entity
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:143)
... 9 more
Caused by: java.lang.ClassNotFoundException net.minecraft.server.v1_4_5.Entity
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:34)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 12 more
@alkarinv
Thanks, works great.
@DonRedhorse
Haven't used spout before, but recently I've been thinking about it moving over to it... so maybe?
very nice plugin... will you make this for spout too?
@iTidez
Which version are you running. You have had to be op to run any of the commands for a long time.
But feel free to add Perms if you would like.