Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Getting The EntityPlayer List
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Av3ng3r5

Getting The EntityPlayer List

By Av3ng3r5, January 18 in Modder Support

  • Start new topic

Recommended Posts

Av3ng3r5    0

Av3ng3r5

Av3ng3r5    0

  • Tree Puncher
  • Av3ng3r5
  • Members
  • 0
  • 1 post
Posted January 18
World world = mc.world;
List<Entity> entities = world.loadedEntityList;

public void onTick(TickEvent.PlayerTickEvent e) {

  int i = 0;

  if (i < entities.size(); i++) {
    if (entities.get(i) instanceof EntityPlayer) {
      EntityPlayer targets = (EntityPlayer) entities.get(i);
    }
  }
}

Hi I am pretty new to mod development and am having some issues getting the (EntityList) of the players and i am getting errors in the following code i'm not sure about that i'm not sure about and if someone could help me out i would really appreciate it. Thanks.

 

Capture.PNG.5011c071bfcd64ee14070b745048368d.PNG

Share this post


Link to post
Share on other sites

diesieben07    7699

diesieben07

diesieben07    7699

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7699
  • 56430 posts
Posted January 18

1.12 is no longer supported on this forum.

Please update to a modern version of Minecraft to receive support.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • troublemaker_47
      TeleportCommand Help

      By troublemaker_47 · Posted 51 minutes ago

      Hello, I am a beginner minecraft modder and i have some problems with a bit of code that would teleport the player in the direction he's facing.can anyone tell me How to merge these lines together: player.getLookVec().scale(2.0F).add(player.getPositionVec()); TeleportCommand;   P.S: i need this to work in minecraft 1.16.5-36.0.15
    • skeletal
      unable to connect to my server

      By skeletal · Posted 58 minutes ago

      hello, every time i try to join my modded server i get the "fatally missing registry entries" error and the "minecraft:wheat (net.minecraft.crafting.shapedrecipies) produces unregistered item minecraft:wheat" error and i dont know what to do, any help would be appreciated here is a screenshot of the console when i try to join:
    • <Gl33p_0r4nge>
      [1.16.4] Screen Render

      By <Gl33p_0r4nge> · Posted 1 hour ago

      Okay I see that no one probably know how but can you at least tell me where should I get the rendered player view?  
    • Luis_ST
      [1.16.5] Help with custom Backpack (slot background and mouse wheel move)

      By Luis_ST · Posted 3 hours ago

      I don't know what code I would still be helpful, so here are the relevant classes in my git repo: TextureStitchEvent: https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/events/other/OnTextureStitchEvent.java BackpackContainer (with custom slot subclass): https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/common/inventory/container/BackpackContainer.java   I think I understood after trying something: my message class requires 3 methods (encode, decode, handle) which I then have to specify when registering the message (parameter 3 - 6). Am I right?
    • troublemaker_47
      Teleport player in same direction as where he looks

      By troublemaker_47 · Posted 4 hours ago

      Can you please tell me how to use the teleportcommand method or its syntax. @diesieben07
  • Topics

    • troublemaker_47
      0
      TeleportCommand Help

      By troublemaker_47
      Started 51 minutes ago

    • skeletal
      0
      unable to connect to my server

      By skeletal
      Started 59 minutes ago

    • <Gl33p_0r4nge>
      1
      [1.16.4] Screen Render

      By <Gl33p_0r4nge>
      Started Monday at 09:58 PM

    • Luis_ST
      9
      [1.16.5] Help with custom Backpack (slot background and mouse wheel move)

      By Luis_ST
      Started Wednesday at 02:47 PM

    • troublemaker_47
      7
      Teleport player in same direction as where he looks

      By troublemaker_47
      Started 21 hours ago

  • Who's Online (See full list)

    • brok4d
    • DmitryLovin
    • Luis_ST
    • matezz
    • Panzer1119
    • ghadi.chalhoub365@gmail.co
    • Jeeyt
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Getting The EntityPlayer List
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community