how can i make this mod???

Started by Kastle on

Topic category: Help with modding (Java Edition)

Last seen on 00:55, 5. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how can i make this mod???

MCreator 2024.2

 

Hi guys, I'm making a horror mod (similar to those Dwellers). I made my 3D model and put it in MCreator. I also did the basics like attack, health, etc. The problem is that I don't understand much about procedures. I know absolutely the basics, since I've only been using MCreator for 3 days.

I want to make 2 types of behaviors. From what I've researched, I need to have 2 entities to do this, one that doesn't attack and another that attacks (I've already done this).

1 - The entity spawns at a random time, observes and follows the player at a considerable distance. The entity will not attack. If the player approaches it within 5 blocks, it will despawn. If the player doesn't approach it, the entity will stay in the world for about 2 minutes and then despawn automatically.

2 - The entity will spawn at random times (with a slightly lower chance of happening) and attack the player. After attacking, it will despawn. If it takes about 2 or 3 minutes to attack the player, it will despawn automatically. When the creature attacks the player, I would like it to have a jumpscare (I know need GeckoLib to do this, already have it installed).

And lastly, I would like to add ambient sounds that play at random times in the game. The chance of this happening must be neither too high nor too low (this also applies to the creatures' spawn).

Both entities cannot spawn at the same time. There must be only 1 entity at a time, and they can spawn in any biome or place.

So that's it. Sorry if I'm asking for too much.

Last seen on 07:45, 14. Sep 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
  I've tried to work this…
Wed, 08/28/2024 - 19:24

 

I've tried to work this out, and there might be a few better ways to do this than what I did, but I think this should work. 

For the entity that spawns without attacking, do something like this for the AI.

e

Following the player is harder, you could try to check for nearby players on the update tick and make them move there if found. From the image above, remove the first block if you don't want it to run away from the player.

On this entities update tick, do this. I added the sound one if you want a sound for this.

e

Put this for initial spawn. Also use this for the other one to make it despawn after a bit.

e

For it attacking then despawning, check when something is attacked and if the source entity is that, despawn the source entity. Or, you could just put despawn in when player collides with this entity. 

Then, this should work for randomly spawning. Adjust these numbers to make them spawn more or less, and add in the entities in the spawn box.

e This should check if the other entity is nearby, and if not, will spawn it. Make the 4 for the cube size a bigger number.

Use this for random sounds, put it in entity update tick, and add a number box after the equal (Sorry, I forgot to add it!)

e

From a jumpscare, maybe have a custom GUI pop up?

Sorry if none of this was useful, I tried! Let me know if this isn't what you wanted or doesn't work, I can try to do other things.

Last seen on 00:55, 5. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hi Thank you very much for…
Wed, 08/28/2024 - 22:19

hi

Thank you very much for your help!

I'm testing and tweaking the spawn, so technically it's working, the ambient sound is also working, but a lot of times it starts repeating the audio over each other, is there any way to fix this?


If it's not too complicated, is there any way to make the mob spawn at a random distance? For example, the maximum distance would be 100 blocks, it can spawn anywhere within those 100 blocks

Last seen on 00:55, 5. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I just remembered this, how…
Wed, 08/28/2024 - 23:52

I just remembered this, how do I make the mob spawn near the player?
because it spawns inside the player, I changed the x y z, and it stopped spawning everywhere

Last seen on 00:55, 5. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
edit: I managed to make the…
Thu, 08/29/2024 - 01:55

edit: I managed to make the mob spawn at a distance close to the player, the problem is that it's spawning lots and lots of mobs non-stop (in this case it's just several mobs with the same behavior, like several that don't attack), how can I only spawn 1 per time?

Last seen on 07:45, 14. Sep 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, ok. Give me a bit and I…
Thu, 08/29/2024 - 09:27

Oh, ok. Give me a bit and I can try to help you.