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

My mod is an Among Us mod that spawns crewmates in the world. I'm trying to make the mod choose between spawning the crewmate entity or the impostor entity with a probability of 0.5 each. How would I do that?
I can provide any code of entities or everything you need in order to help me.  :)(Except the things I've tried to make the spawning probability, because I don't have them anymore lol).

This is not a teach me how to mod forum. It is a support forum.

 

You need to show what you have tried that you think should work.

Preferably with the minimum amount of code on github so we can reproduce your problem.

If we have to waste time asking for that information, we probably won't, instead your question will likely just get ignored unless the problem is obvious from the small amount of information posted.

 

Anyway, the answer to this vague question can probably be found by comparing your code with Zombie.finalizeSpawn() or one of the other vanilla entities that can spawn multiple types?

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.

  • Author

So would both entities' codes be enough? I really need help at this. And I'm not sure if the Zombie would work because the crewmate and impostor are two different entities?

36 minutes ago, warjort said:

If we have to waste time asking for that information, we probably won't, instead your question will likely just get ignored unless the problem is obvious from the small amount of information posted.

If you don't post more concrete information with your question, I am just going to ignore this thread until you do.

I am not going to waste more time making further incorrect guesses about what you are doing (like they were the same entity type) only to give you more incorrect/irrelevant answers.

 

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.

  • Author

Well, I've never said that they were the same entity type...
I have two different entities, Crewmate and Impostor. And I want the Impostor to spawn among the crewmates with a probability (50% for example). That's it. I know how to do the probability thing, but I don't know how to use that probability to spawn them.

But they are different entity types, otherwise they couldn't be different entities.

https://github.com/yoshibv/Amodgus/blob/356a2b0098112ca73b26131de0765e06ec636c80/src/main/java/es/yoshibv/amodgus/init/MobsInit.java#L18

 

Each spawn group can only have one entity type. I believe this is yours?

https://github.com/yoshibv/Amodgus/blob/356a2b0098112ca73b26131de0765e06ec636c80/src/main/resources/data/amodgus/worldgen/structure/ship.json#LL46C2-L46C2

 

So I guess you have 3 choices. There might be others?

* Make them the same entity type so the same spawn configuration spawns both and randomly select which spawns in finalizeSpawn()

* Make separate spawn configurations for the 2 entity types but that means they won't spawn in the same groups

* Have a "hack" where the Amongus.finalizeSpawn() has a chance to spawn a separate Imposter in its finalizeSpawn() method.

 

You can see something similar in that Zombie.finalizeSpawn() I mentioned before where it spawns a chicken for chicken jockeys.

But I am not sure what consequences it would have if you use finalizeSpawn() to spawn a new entity that the current entity is not riding?

I can't think of any vanilla examples that do something like that. I would guess the main problem is making sure they don't spawn at the same BlockPos?

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.

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.