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.

Featured Replies

Posted

Hello. How can I spawn my animal at world generation?

 

My animal class - https://github.com/NightKosh/Sophisticated-wolves/blob/feature/1.19.2_update/src/main/java/sophisticated_wolves/entity/SophisticatedWolf.java

 

I've read a few totorials, about it, and add :

1) biome modifier - https://github.com/NightKosh/Sophisticated-wolves/blob/feature/1.19.2_update/src/main/resources/data/sophisticated_wolves/forge/biome_modifier/sophisticated_wolves_spawn_biome_modifier.json

2) SpawnPlacementRegisterEvent - https://github.com/NightKosh/Sophisticated-wolves/blob/ba79daeeb2d6bc08814c6b5976491b381ba8bcb1/src/main/java/sophisticated_wolves/event/EventsEntity.java#L28

but for some reasons my game freezed when I entered to a place where mob should be spawned.

"debug" and "latest" logs have no helpfull information.

 

Edited by Kosh

You need to look at the stacktrace of the thread that is deadlocked or looping.

You can do that either with a debugger or if you are running from the command line, the jdk tool jstack will give you a thread dump.

https://www.baeldung.com/java-thread-dump

 

But I would guess your problem is in the finalise spawn/biome access.

Here you are accessing the level directly:

https://github.com/NightKosh/Sophisticated-wolves/blob/fb176ace6d9c25ec13ffccd7003d926405601f06/src/main/java/sophisticated_wolves/entity/SophisticatedWolf.java#L410

But it is called indirectly from world generation here:

https://github.com/NightKosh/Sophisticated-wolves/blob/fb176ace6d9c25ec13ffccd7003d926405601f06/src/main/java/sophisticated_wolves/entity/SophisticatedWolf.java#L160

You should be using the LevelAccessor not the Level so you get the data from the ProtoChunk (the chunk while it is being generated)

Otherwise it will go something like this:

1) Minecraft needs to generate a chunk

2) Chunk decides to spawn your entity

3) You ask for the biome of the chunk from the real level data, but the chunk is not loaded yet, it still being generated

4) Minecraft puts the thread in a wait state until the chunk has finished generating, but it never will be because the thread doing the generation is now waiting on itself.

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

  • Kosh changed the title to [1.19.2, SOLVED] Mob spawn at world generation \ game freezed

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.