Jump to content

Alternis

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Alternis

  1. Thank you very much, it worked flawlessly. I did have to fiddle around with predicates for a while but that's because I never touched the functional part of interfaces. I ended up reading these examples which helped me very much understand how to. For future reference, this is how my "player finder" looks : Predicate<Entity> predicate = i -> !(i.equals(playerIn)); PlayerEntity nearestPlayer = worldIn.getClosestPlayer(launcherXPos, launcherYPos, launcherZPos, 5000, predicate); Have a nice day, alternis
  2. Hello ! I have been trying to make a "simple" item that, when used : Finds the nearest player in a range Sends a snowball in its direction if a player was found Sends a message in chat if no player was found in range I achieved some sort of success by using this : List<Entity> entities = worldIn.getEntitiesWithinAABBExcludingEntity(playerIn, playerIn.getBoundingBox().expand(50000.0D, 50000.0D, 50000.0D)); Then, I iterated through the list using instanceof like the bad encapsulator I am. Little I knew that it would make the game freeze a few seeconds each time I used the item AND would have a ridiculously low range. I tried using a lot of other stuff, but no luck, so I'm asking you Forge experts :) Thanks for reading me, alternis
×
×
  • Create New...

Important Information

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