Jump to content

camogamer

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by camogamer

  1. Thank you for the response, I should probably check to make sure i'm up to date and if the problem persists i'll do that.
  2. I am constructing a mod that has zombies spawning a good distance away from a random player by custom means. At this range the default despawn code immediately removes them, so in my mod I am using the forge event ( LivingSpawnEvent.AllowDespawn ) to deny the despawn, however this is not working in some cases. I have found the enabling persistence on the mob will allow it to function at these distances, but I do not know a way to remove that persistence without killing the mob manually, which is undesirable. In the EntityLiving Class I have found that the if statement in the despawn entity method has an extra logic operation that I do not completely understand: idletime & 0x1f = 0x1f I went and learned what I could about hexadecimal and bit-wise operators and from that, this seems unlikely to evaluate to true most of the time, making denying the spawn pointless. Can someone help explain when this would be true, or can someone let me know if I can turn off persistence on a mob?
  3. I do think this is the way to go but does anyone know if and how i could look up the view distance / chunk load range for the server? EDIT: I found the setting in the PlayerList class after a fair amount of digging.
  4. For my current project I am building a zombie apocalypse mod and I am unsure how best to approach my current problem: Making zombies spawn at the edge of the loaded world. I have thought of a few possible solutions as follows: 1. Have a class track all edge chunks. (chunks that I have tested to see if the neighbors are loaded) 2. Use chunks at the edge of the player's load range (I have no idea how to access this setting, and do not want to just assume it) If anyone could help point me in the right way I would greatly appreciate it. Thanks, Camogamer
  5. My Goal: Create spectator-like mode but allow ai and wander and spawn still. My Problem: The noClip field is tied to a player's gametype. I have looked through the EntityPlayer class and noClip is set by isSpectator() early in the onUpdate, immediately after the first phase of PlayerTickEvent. The next chance to set noClip to true appears to be in EntityLivingBase onUpdate and that is where i am attempting to set it which is before any logic happens regarding noClip in EntityPlayer. This is not working. I believe must have missed something in a child class or is this even possible through forge? I have also attemped to change the collision box during GetCollisionBoxesEvent with no luck. Any input appreciated. EDIT: As with everything that should work I made a simple mistake, I was not setting noClip on each side. Setting noClip in LivingUpdateEvent works as expected.
×
×
  • Create New...

Important Information

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