Jump to content

Leaderboard

Popular Content

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

  1. LivingSpawnEvent is the parent of several events, don't subscribe to it directly unless you want to receive every child and you don't care which one is which (which usually isn't the case). LivingSpawnEvent.CheckSpawn is only fired for living entities that spawn passively (in WorldEntitySpawner) and for entities that spawn from mob spawners (in MobSpawnerBaseLogic). Setting the result to DENY will prevent the entity from spawning. LivingSpawnEvent.SpecialSpawn is fired just after LivingSpawnEvent.CheckSpawn in the same places. Cancelling it will prevent the entity from spawning. LivingSpawnEvent.AllowDespawn is fired when a living entity is about to despawn, setting the result to DENY will prevent the entity from despawning. EntityJoinWorldEvent is fired when any entity is about to be spawned (regardless of what kind of entity or where it's being spawned from). Cancelling it will prevent the entity from spawning. LivingSpawnEvent.CheckSpawn, LivingSpawnEvent.SpecialSpawn and EntityJoinWorldEvent can all be used to prevent entities from spawning, the difference is which entities the events are fired for and which additional effects will be prevented when you cancel/deny the event. If the entity is covered by the LivingSpawnEvent children, you should prevent the spawn as early as possible (i.e. with LivingSpawnEvent.CheckSpawn) to stop any additional effects related to the spawning from happening.
    2 points
  2. Character length only matters for Code Golf. That said, if you wanted to use a while loop, you can save characters: Instead of: int x = -aoe; ... { while(x != aoe) { x++; } x= -aoe; y++; } You can do: ... { int x = -aoe; while(x != aoe) { x++; } y++; } By declaring the value at the top of the loop you save having to reset it at the end.
    1 point
  3. Yes, the order is CheckSpawn, SpecialSpawn and then EntityJoinWorldEvent. If an entity with a mount or passengers is spawned, CheckSpawn/SpecialSpawn will only be fired for the main entity; but EntityJoinWorldEvent will be fired for every entity. SpecialSpawn is only fired by mob spawners when only the ID of the entity has been specified in the WeightedSpawnerEntity NBT. If the NBT tag has anything except the ID in it, SpecialSpawn won't be fired.
    1 point
  4. I started upgrading to 1.11.2 yesterday, and get 1500+ errors. After temporarily removing some parts of my mod which are closely related to rendering, It can run in 1.11.2. Trying to rewrite the rendering code and solve weird bugs QAQ
    1 point
  5. 1 point
×
×
  • Create New...

Important Information

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