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
@Thegh0st2
Yeah thats possible, what are you trying to check there?
@StefanoPorta
Unfortunately since VirtualPlayers dont show up in the "online" server list, sometimes other plugins will throw errors. Usually those errors won't stop the other plugin from working, and are really just more annoying to look at than anything else.
That is the case here, it's an ugly error, but AuthMe will probably work just fine.
When I try to do teh command /dc p1 connect the plugin throws me this error:
Is it possible for you to put in moving (like /dc <vp> <pos1> <pos2>) as like a normal player?
@alkarinv
tyvm
@Thegh0st2
I released versions for 1.6.1 and 1.6.2 yesterday. They should be approved by bukkit soon!!
@Jo11yWombat
Hmm, I'll add that in, why not :)
Needs an update... please do
Is there any way for me to change the color of their name in chat?
@xyz1346
That should work for you! yeah, it can get overwhelming.
Is there a way to remove it's logging to the console?
I hate how every time someone chats or i have it execute a command it logs in the server log / console. It spams the console a ton when i have a few virtual players.
Even when I do /dc playername disconnect they still show up in console just as (offline). Ahh!
@xyz1346
You're welcome!! :)
@rudolf323
Read the errors.. It's a conflict with another plugin you are running called orebfuscator. Probably harmless since it disables it for ops anyways.
I just want to thank you for this plugin.
Don't know how you did it but this allows me to use worldedit from the console and thus allows me to write denizen/citizens 2 scripts that make use of world edit and schematics. I have been looking for a way to do this since it broke almost a year ago and had resorted to block-by-block changing. You just made my life so much easier. THANK YOU SO MUCH; now all my awesome animated ideas can come to life.
Please never let this plugin break as my server literally depends on it!
Liam
theKingdome server owner
www.kingdome.info
@alkarinv
well, I don't have any problems with writing chat bot itself, but I do have problems to make that player just like any another online player, showed in online list and recognized by plugins. I don't want to let people know that it's chat bot, I'd like to make it looks like a player. Citizens doesn't seems to contain that function
@rudolf323
Unfortunately not much I can do about those, VirtualPlayers aren't real and some plugins Need them to be. Probably best in your case to only use them as debugging.
This is spamming in console after connecting a player - /dc nickname connect
I'm using version for 1.5.2
@alkarinv
Sweet. thanks very much
@SuperMinecraftBrosMC
I just released an update now. It just needs to be approved by bukkit
@rsod
Sounds like you just need an automated help system. You could get VirtualPlayer to say those messages, but its really unnecessary for what you want to do. I don't really know of any systems like that though, you should definitely hit up bukkit search :)
@rsod
Does citizens work with that? It actually creates the character so might be closer to what you want to do.
Update to 1.5.2 Please?
basically what I'm trying to do is make thing like talking bot for the server.. you know, players usually not really talking with new players, they're busy or just doesn't wants to, so what I'm trying to create is a bot which can say "hi/bye" to people, and answer to some their questions, like "how to claim land", "how to get to another world", "where are shops", and another simple things like that. I don't have any problems with writing talking part, I can even mess around with packets and add player to tab-list, can try to add it to online list as well, but it will not really assuming as online player. And what I need is "fake" player so any another plugins will assume it as actual player. Well, I can for example launch 5 minecraft clients and join under those nicknames, and keep clients on, but its too expensive and it's not really impossible to keep connection 24/7. If you don't want to do that by yourself, I understand, maybe it's too long and not really necessary for most servers/server owners, but as you created that plugin maybe you know in which direction I can look for that effect?
We all know chgusers plugin, but it's bugging out as hell, because it isn't fully recreates player and when plugins trying to get some information from it, they just throwing a bunch of errors
hey alkarinv may I ask you a question, as to experienced coder, is there a way to completely recreate player instance on the server and fool plugins, so just every plugin will think so player is online? And actually simulate any method so plugins will not generate exceptions when trying to do something with that "player"