Jump to content

Get GameProfile of FakePlayer


Raycoms

Recommended Posts

Hello,

I am trying to figure out how I can get the GameProfile of a FakePlayer only by its name. Some mods add fakePlayers and give them certain names.
Is there a way to check if a fakePlayer with that name exists and to get his gameProfile or fakePlayer object?

Thanks

Link to comment
Share on other sites

There is a HashMap containing all FakePlayers located in the FakePlayerFactory class.
Do note that it is private, so you will need to use Reflection to see it.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

That would be bad for all anti griefing mods.

[Mekanism] - Mekanism
[BuildCraft] - BuildCraft
[Forestry] - Forestry 
ComputerCraft - ComputerCraft
[OpenComputers] - Open Computers
[Stevescart] - Steve's Carts
[MineFactory] - MineFactoryReloaded
[CoFH] - Autonomous Activator
[SFM_PLAYER] - Steve's Factory Manager
[EioFarmer] - Ender IO Farmer
FakeThaumcraftGolem - Thaumcraft Golems
FakeThaumcraftBore - Thaumcraft Arcane Bore
[EioKillera] - Ender IO KillerJoe
[Minecraft] - Extra Utilities

This is a list of all the "well known" fake players of various mods.
I hope these mods have taken these usernames to avoid griefing by them.

Link to comment
Share on other sites

1 minute ago, kimbeardsley said:

My Code:

FakePlayer fakePlayer = FakePlayerFactory.get(Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(0), new GameProfile("tattyseal_fake", "tattyseal"));

 

That code reaches across logical sides by accessing the server through the Minecraft class, which is client-only. It will also crash the dedicated server.

 

Since FakePlayer extends EntityPlayerMP and requires a WorldServer, it should only be used from the logical server.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.