Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/25/20 in all areas

  1. You are on the right track, and I agree that the vanilla respawn code is complex. Here is how I solved it: (Make sure to put this after a !world.isRemote check to avoid reaching across sides) ServerPlayerEntity player = (ServerPlayerEntity) event.player; // Get the player somehow (from a parameter or similar) ServerWorld respawnWorld = player.server.getWorld(player.func_241141_L_()); BlockPos spawn = player.func_241140_K_(); float spawnAngle = player.func_242109_L(); boolean forcedSpawn = false; boolean preserveAnchorCharges = true; Optional<Vector3d> maybeSpawn = PlayerEntity.func_242374_a(respawnWorld, spawn, spawnAngle, forcedSpawn, preserveAnchorCharges); Then the maybeSpawn will contain the respawn position of the player, and the respawnWorld will be the world in which the player will respawn. Of course, the maybeSpawn can be empty, and then you have to get the respawn position from the world.
    1 point
  2. Probably. Which means that it is a lower priority than the regular BreedGoal because it's later in the task list. You either: (a) need to remove the original goal (b) make your goal have a higher priority
    1 point
  3. AI tasks have a priority value and a "can run simultaneously" bitmask value. If your task has the same bits set as another take, but a lower priority (towards positive infinity, iirc) then it won't run. So Show your code.
    1 point
  4. Have you tried ModItems.MESSAGE_SCROLL.get()? The method comment for RegistryObject::get is:
    1 point
  5. Which parts are you not understanding? The explanation is very basic Java, and if you don't understand that, you are going to have a Very Bad Time trying to mod. Not trying to be mean, just stating facts. There isn't really a much easier way to explain what vemerion said without going to Java School (this isn't Java School, this is Forge School )
    1 point
  6. You could perhaps listen to the PotionRemoveEvent and check for a specific effect, and then cancel the event.
    1 point
×
×
  • Create New...

Important Information

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