Modding partnership

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
Are you asking for several variants of PE blocks?

Fixed mobs spawning without items.
No. A separate mod that allows you to specify a block in the config to turn into a "spawner" (similar to PE) with same config options on rate of spawn and mob list. Even more amazing if you could configure up to 8 blocks with their own independant rates of spawning and spawn lists.

An alternative to vanilla mob spawners that can be hidden in plain sight and not affected by light levels.


In my modpack, I have alien spires spawning around made from a couple of unique blocks, and they have vanilla spawners scattered about them, but it looks bad, and nothing spawns in the day.
 

Alexiy

Well-Known Member
Mar 3, 2014
229
128
68
Riga, Latvia
No. A separate mod that allows you to specify a block in the config to turn into a "spawner" (similar to PE) with same config options on rate of spawn and mob list. Even more amazing if you could configure up to 8 blocks with their own independant rates of spawning and spawn lists.

An alternative to vanilla mob spawners that can be hidden in plain sight and not affected by light levels.


In my modpack, I have alien spires spawning around made from a couple of unique blocks, and they have vanilla spawners scattered about them, but it looks bad, and nothing spawns in the day.
So, basically, make it possible for specified blocks turn into a custom mob spawner? For example, have a chance of random sand block be replaced by said spawner (without spread ability)?
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
So, basically, make it possible for specified blocks turn into a custom mob spawner? For example, have a chance of random sand block be replaced by said spawner (without spread ability)?
If the config is sand, then all sand becomes the spawner. (naturally you wouldn't do that but use very specific blocks, but that's down to the mod user/pack maker).
That's assuming of course that existing blocks can be modified like that, otherwise it would be new blocks that inherit the same properties of the target block.

and yes, no spreading. These are just spawning blocks.
 

ICountFrom0

Forum Addict
Aug 21, 2012
906
1,227
159
Vermont
okay, that's cool. I've already got a deal setup with somebody else who's done 3 projects for my modpack, but it's cool that you are doing it.

Thank you.
 
  • Like
Reactions: Alexiy

Alexiy

Well-Known Member
Mar 3, 2014
229
128
68
Riga, Latvia
If the config is sand, then all sand becomes the spawner. (naturally you wouldn't do that but use very specific blocks, but that's down to the mod user/pack maker).
That's assuming of course that existing blocks can be modified like that, otherwise it would be new blocks that inherit the same properties of the target block.

and yes, no spreading. These are just spawning blocks.
Do you mind if I use my library for this mod?

I've managed to design a block-based spawning system with a config similar to your example, but I made it in Json - this way you can define unlimited entries, for example:
Code:
[
  {
    "minecraft:sand" : {
      "chance": 80,
      "entities": [
        "minecraft:husk",
        "minecraft:sheep"
      ]
    }

  },
  {
    "minecraft:grass" : {
      "chance" : 75,
      "entities": [
        "minecraft:ocelot",
        "minecraft:polar_bear"
      ]
    }
  }
]

The system works by choosing a random top-most position in a 80 block radius from the player, checking whether a block there is defined in the config, then rolling rng, and spawning an appropriate mob. Any thoughts?
 
Last edited:
  • Like
Reactions: Celestialphoenix

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
Do you mind if I use my library for this mod?

I've managed to design a block-based spawning system with a config similar to your example, but I made it in Json - this way you can define unlimited entries, for example:
Code:
[
  {
    "minecraft:sand" : {
      "chance": 80,
      "entities": [
        "minecraft:husk",
        "minecraft:sheep"
      ]
    }

  },
  {
    "minecraft:grass" : {
      "chance" : 75,
      "entities": [
        "minecraft:ocelot",
        "minecraft:polar_bear"
      ]
    }
  }
]

The system works by choosing a random top-most position in a 80 block radius from the player, checking whether a block there is defined in the config, then rolling rng, and spawning an appropriate mob. Any thoughts?
Any thoughts?

AMAZING!

Something some people might like is an option to use or ignore light level spawning rules. Adds to the flexibility for themed pack makers
 

Alexiy

Well-Known Member
Mar 3, 2014
229
128
68
Riga, Latvia
Any thoughts?

AMAZING!

Something some people might like is an option to use or ignore light level spawning rules. Adds to the flexibility for themed pack makers

A prototype is ready. I added few settings to control the spawning, and added a "max_light" key to Json config which defines the maximum light level for given group of mobs to spawn. Here is an example file:

Code:
[
  {
    "minecraft:sand" : {
      "chance": 50,
      "max_light" : 15,
      "entities": [
        "minecraft:husk",
        "minecraft:sheep"
      ]
    }

  },
  {
    "minecraft:grass" : {
      "chance" : 15,
      "max_light": 10,
      "entities": [
        "minecraft:ocelot",
        "minecraft:polar_bear"
      ]
    }
  },
  {
    "minecraft:obsidian" : {
      "chance" : 90,
      "entities": [
        "minecraft:witch"
      ]
    }
  },
  {
    "minecraft:stone" : {
      "chance" : 90,
      "entities": ["minecraft:silverfish"]
    }
  }
]

"max_light" can be omitted, in this case there won't be a check for light.

The mod will create a file "positional_spawning.json" on launch. It will be parsed for entries. But - you can have any amount of such Json files, and you can switch to using another one without restarting the game. To do that, change the file name in mod options to desired one.
I also added a command "ps reparse" - use it when you switch the config file or change the active one.
Download - https://drive.google.com/open?id=1xeWUZn4aO7ef5Fgjc__wlQIIjn6VYglK
It will require Satako library.
Awaiting bug reports... : )
 
Last edited:
  • Like
Reactions: Golrith

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
most likely won't be able to test till the weekend, but what you've explained sounds perfect!
 
  • Like
Reactions: ICountFrom0

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
A prototype is ready. I added few settings to control the spawning, and added a "max_light" key to Json config which defines the maximum light level for given group of mobs to spawn. Here is an example file:

Code:
[
  {
    "minecraft:sand" : {
      "chance": 50,
      "max_light" : 15,
      "entities": [
        "minecraft:husk",
        "minecraft:sheep"
      ]
    }

  },
  {
    "minecraft:grass" : {
      "chance" : 15,
      "max_light": 10,
      "entities": [
        "minecraft:ocelot",
        "minecraft:polar_bear"
      ]
    }
  },
  {
    "minecraft:obsidian" : {
      "chance" : 90,
      "entities": [
        "minecraft:witch"
      ]
    }
  },
  {
    "minecraft:stone" : {
      "chance" : 90,
      "entities": ["minecraft:silverfish"]
    }
  }
]

"max_light" can be omitted, in this case there won't be a check for light.

The mod will create a file "positional_spawning.json" on launch. It will be parsed for entries. But - you can have any amount of such Json files, and you can switch to using another one without restarting the game. To do that, change the file name in mod options to desired one.
I also added a command "ps reparse" - use it when you switch the config file or change the active one.
Download - https://drive.google.com/open?id=1xeWUZn4aO7ef5Fgjc__wlQIIjn6VYglK
It will require Satako library.
Awaiting bug reports... : )
Finally I've been able to test this out.

Bug report - I can't seem to get it to work :D

This is my json:

Code:
[
  {
  "techguns:slimy" : {
  "chance": 50,
  "entities": [
  "techguns:alienbug",
  "techguns:alienbug",
  "techguns:alienbug",
  "techguns:alienbug",
  "minecraft:spider",
  "minecraft:silverfish",
  "minecraft:slime",
  "minecraft:cave_spider"
  ]
  }
  }
]

But when I approach that particular block, nothing happens. Looked through my log, can't see anything relevant.
 
Last edited:

Alexiy

Well-Known Member
Mar 3, 2014
229
128
68
Riga, Latvia
For performance reasons, the mod doesn't search for blocks specified in the files - it rather takes a random position around the player, then checks if a block in that position is one of specified, then rolls the RNG and spawns mob on success. This means that chance of specified mobs to spawn is proportional to amount of that block around the player. This is solely for avoiding lag, because checking all blocks around the player is more cpu-expensive than selecting a random one.
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
For performance reasons, the mod doesn't search for blocks specified in the files - it rather takes a random position around the player, then checks if a block in that position is one of specified, then rolls the RNG and spawns mob on success. This means that chance of specified mobs to spawn is proportional to amount of that block around the player. This is solely for avoiding lag, because checking all blocks around the player is more cpu-expensive than selecting a random one.
Hmm. I hung around an area with a number of these blocks. I'll try again.
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
For performance reasons, the mod doesn't search for blocks specified in the files - it rather takes a random position around the player, then checks if a block in that position is one of specified, then rolls the RNG and spawns mob on success. This means that chance of specified mobs to spawn is proportional to amount of that block around the player. This is solely for avoiding lag, because checking all blocks around the player is more cpu-expensive than selecting a random one.
Okay. Built a large area of the block I'm using, upped the Entity Limit in the config to match the Polluted Earth config in my pack. Still nothing happening. No spawning :(
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
Is there any suspicious output in the console?
Nothing that I could see. I eyeballed, and searched for the block name (slimy) and mod name as usually they are referenced in errors.
 

Alexiy

Well-Known Member
Mar 3, 2014
229
128
68
Riga, Latvia
Nothing that I could see. I eyeballed, and searched for the block name (slimy) and mod name as usually they are referenced in errors.
It was my fault, I screwed up my math. Now I changed spawning algorithm, and it works.
Next version ~
But if you notice lag during this mod's work, you should decrease the "spawnRadius" variable - the higher it is, the more lag there may be ("can't keep up" messages).
 
  • Like
Reactions: Golrith

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
It was my fault, I screwed up my math. Now I changed spawning algorithm, and it works.
Next version ~
But if you notice lag during this mod's work, you should decrease the "spawnRadius" variable - the higher it is, the more lag there may be ("can't keep up" messages).
Cool, I'll check it out as soon as I can.
 

Alexiy

Well-Known Member
Mar 3, 2014
229
128
68
Riga, Latvia
Positional Spawner has been reworked, several problems were resolved, and the format of the json config was changed, resulting in more flexibility. Planning to release it on curseforge soon.