need Help regarding Mob Spawning using a custom prodecure [FABRIC]

Started by Leobaker on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
need Help regarding Mob Spawning using a custom prodecure [FABRIC]

so am workin on a mod that adds Herobrine in the game, now this mod is gonna use custom stuff to control the spawning of it and since Fabric does not support Player Tick, instead of using Player Tick i was gonna make it so it checks everytime the player breaks a block or does most things that are unavoidable to get around it

Just one problem

While it does work the issue is say, if the player breaks a block, it spawns him right where the block was broken which of course, is NOT what i want it to be doing

But rather spawning him in a random location somewhere near the player like what most Mobs would do, and i would use the normal spawning system but that appears to both be limited and well, having issues with ensuring only ONE of him can ever spawn

So i basicly need to know how to tell it to spawn him near the player from a far distance but not right where the player might do something like break a block (and making sure it correctly spawns him on a location and not inside of a wall or something)

This is the code i have atm (Annnnnnnnnnnnnd Never mind because for some reason you don't support just copying and pasting the image directly....)

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh and don't just tell me…
Thu, 11/30/2023 - 13:02

Oh and don't just tell me what block to use, thats basicly tells me nothin since am still kinda new to this, but at least have rough ideas what some things do, just maybe not 100% how to setup every single thing completely in a prodecure depending on its complexity

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Maybe this is not what you…
Thu, 11/30/2023 - 21:04

Maybe this is not what you were looking for, but couldn't you make him spawn at a random offset from the block? Like, spawn entity at x random y random z random. You could change how random it is to spawn closer or further.

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
wouldn't a random Y put him…
Thu, 11/30/2023 - 21:30

wouldn't a random Y put him into a wall

and Yes technicly thats what i'd want, issue tho is am pretty sure it will spawn him else because of how cordinates work, but lemme see what that'd code be before id assume