Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Choonster

Moderators
  • Joined

  • Last visited

Everything posted by Choonster

  1. Anything spawned by WorldEntitySpawner#findChunksForSpawning. This includes any passive or hostile entities spawned in the chunks surrounding players, but not entities spawned in a newly-generated chunk.
  2. 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.
  3. I don't know of any tutorials, but I will say that DimensionManager still exists.
  4. The Vanilla and Forge registries are stored in the ForgeRegistries class. I think you mean @ObjectHolder.
  5. This PR would have allowed you to control the movement speed while the item was in use, but the author hasn't responded for a while. If you were to update it, it may be merged for 1.12.1 and possibly 1.11.2.
  6. 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.
  7. SoundHandler#onResourceManagerReload explicitly iterates through every copy of sounds.json for each domain (using IResourceManager#getAllResources), it doesn't just use first one it finds (using IResourceManager#getResource) like most other places in the code do. Looking at the code, it should only replace the sounds present in each sounds.json file (that opt-in to replace existing sounds); I'm not sure why the other sounds are being removed. Try setting a breakpoint in SoundHandler#onResourceManagerReload and stepping through the code.
  8. IStorage#writeNBT is @Nullable, so it can return null. IStorage#readNBT can simply be a no-op. If your capability doesn't need to be serialised to NBT, don't implement INBTSerializable on the ICapabilityProvider you attach with AttachCapabilitiesEvent.
  9. In the launcher, give the profile for each version a separate game directory.
  10. Are there any errors in the log?
  11. RegistryEvent.MissingMappings<T extends IForgeRegistryEntry<T>>, where T is the registry type you want to remap (e.g. Block, Item, Biome).
  12. GUIs only exist on the client, but the server is in control of the game state. You need to send a custom packet to the server when the player clicks the button and make the changes to the player's held item in the packet's handler.
  13. That's not the Minecraft game directory and those aren't the same file names mentioned in the log. This is where Forge is looking for mods: In future, you can follow these instructions when someone asks for a screenshot. This will be much easier to read than a photo of your monitor.
  14. Minecraft has several randomised structures larger than a chunk, e.g. Strongholds, Nether Fortresses, Ocean Monuments, End Cities and Woodland Mansions. You can find the implementations in the net.minecraft.world.gen.structure package. The latter two use the Structure Block format rather than manually setting blocks in code.
  15. Which mods weren't detected? Where did you download the mods from? Post a screenshot of your mods directory.
  16. That is the FML log, but there's nothing about mod rejections in it. Was your connection to the server rejected in that session?
  17. Post the FML log (logs/fml-client-latest.log in the game directory) using Gist or Pastebin.
  18. It's still possible to register recipes from code, but they should be migrated to JSON where possible. If needed, you can create your own recipe, ingredient and condition factories to use from JSON. Now that recipes are managed by a registry, IRecipe implements IForgeRegistryEntry and instances can be registered in RegistryEvent.Register<IRecipe>.
  19. A ticking TileEntity or a TileEntity with a TESR are probably your best options here.
  20. Have you tried making an IIngredientFactory like I recommended? I just implemented one to do this here. I ended up using a custom Ingredient that never matches any ItemStack rather than using Ingredient.EMPTY; this is to prevent the Ingredient from matching an empty ItemStack when the conditions aren't met. I also added a recipe like your example that uses a compound ingredient consisting of an itemRubber ore ingredient and a conditional ingredient that matches Thermal Foundation's Rosin when Thermal Foundation is loaded.
  21. This should have been fixed by this commit (Forge 1.12-14.21.1.2423). Make sure you're using the latest version of Forge.
  22. If you're spawning particles through the World/RenderGlobal methods, they'll only spawn within 32 blocks (exclusive) of the player unless you tell it to ignore the range (by using a vanilla particle type that ignores range or by calling one of the overloads with an ignoreRange parameter). Block#randomDisplayTick will only be called for blocks that are within 32 blocks (exclusive) of the client player on every axis.
  23. Since particles only need to be spawned on the client, just check how far away the client player is from the block before spawning them.
  24. World Saved Data should be what you need. It can be attached per-dimension or per-save. Each side has its own copy of the data, syncing needs to be done manually.
  25. Is this data only used by the save it's attached to, or do you need to access the data of other saves?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.