Giter VIP home page Giter VIP logo

Comments (10)

superckl avatar superckl commented on July 3, 2024 1

I have also fixed the documentation of the addSpawn command.

from biometweaker.

superckl avatar superckl commented on July 3, 2024

You can effectively weight entries by lowering or raising their spawn cost. There is no actual weighting system anymore, but this is roughly equivalent. A lower cost entity will spawn more frequently.

from biometweaker.

jamesjimmy88 avatar jamesjimmy88 commented on July 3, 2024

Does this mean that the weight values in the default vanilla datapack are useless then? Good to know, thanks.

from biometweaker.

jamesjimmy88 avatar jamesjimmy88 commented on July 3, 2024

I think the weight is actually a parameter?

public ScriptCommandAddSpawn(final BiomePackage pack, final String stage, final ResourceLocation rLoc, final int weight, final int minCount, final int maxCount) throws ClassNotFoundException {

I tried doing

soulSandValley.addSpawn("MONSTER", "minecraft:wither_skeleton", 1, 5)
soulSandValley.setSpawnCost("minecraft:wither_skeleton", 0.15, 0.75)

But I get an arror in the chat:
Failed to parse arguments for command addSpawn("MONSTER", "minecraft:wither_skeleton", 1, 5) @ ScriptContext[scriptName=main.cfg, lineNumber=2]. Reason: No constructors found with matching arguments.

I tried adding an extra numeric parameter and it doesn't throw any error (it still doesn't add any mob, but but at least it compiles)

from biometweaker.

superckl avatar superckl commented on July 3, 2024

Ah, yes, this is my mistake in generating the docs. There is a weight parameter that is the first numeric argument of three at the end. You can verify that the spawn is being added by regenerating the output files.

from biometweaker.

jamesjimmy88 avatar jamesjimmy88 commented on July 3, 2024

I can't find anything in the output scripts. I assume there should be something in either .minecraft\config\biometweaker\output\entity\minecraft_wither_skeleton.json or .minecraft\config\biometweaker\output\biome\minecraft_soul_sand_valley.json, but there's no mention of spawns in the biome file and there's no biome list in the entity's file. Still, the script is working as intended (it's easy to check since it replaces mobs in a biome), I'll just leave it here for anybody that eventually stumbles upon this issue :

soulSandValley = forBiomes("minecraft:soul_sand_valley")
soulSandValley.removeSpawn("MONSTER", "minecraft:skeleton")
soulSandValley.addSpawn("MONSTER", "minecraft:wither_skeleton", 5000, 1, 5)
soulSandValley.setSpawnCost("minecraft:wither_skeleton", 0.15, 0.75)

Just a small side note: I was being dumb and I did forBiomes("minecraft_soul_sand_valley") instead of forBiomes("minecraft:soul_sand_valley") (I mistakenly copied the name of the output file), but I didn't get any error. The lack of error messages might be intended, but I thought it was worth mentioning.

from biometweaker.

superckl avatar superckl commented on July 3, 2024

That should cause an error to be printed in the log, it won't crash the game. Not seeing spawns in the biome output is also a bug that you should look into in the log.

from biometweaker.

jamesjimmy88 avatar jamesjimmy88 commented on July 3, 2024

I made a new instance just to test this. This is the test script I used:

soulSandValley = forBiomes("minecraft_soul_sand_valley")
soulSandValley.removeSpawn("MONSTER", "minecraft:skeleton")
soulSandValley.addSpawn("MONSTER", "minecraft:wither_skeleton", 5000, 1, 5)
soulSandValley.setSpawnCost("minecraft:wither_skeleton", 0.15, 0.75)

And here is the log
https://pastebin.com/JFE0F3z9
I don't see anything in there, and there is obviously nothing in the output files since the biome name in the script is wrong

from biometweaker.

jamesjimmy88 avatar jamesjimmy88 commented on July 3, 2024

I restarted the instance after correcting the script and I regenerated the output files. Everything is working fine, but I still don't see anything in them.
minecraft_soul_sand_valley.json: https://pastebin.com/HJ305xTD
minecraft_wither_skeleton.json and minecraft_skeleton.json: https://pastebin.com/x6XuE0qY

from biometweaker.

superckl avatar superckl commented on July 3, 2024

So what's happening here is a few things:

  • The lack of error is because I now store resource locations internally and there is no check that the resource location actually corresponds to a biome. At some point after the initial registry setup, a check should be run to verify all the resource locations actually correspond to a biome.
  • Spawn information is not included in output because of holder issues causing me to use the network codec and I forgot to manually serialize the spawn info. I'll have to add that back in.

from biometweaker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.