Mods / Jack's Tall Grass

Category: #Tweak
Author: JackRob
Side: Both
Created: Oct 21st at 7:14 PM
Last modified: Oct 21st at 10:28 PM
Downloads: 502
Follow Unfollow 36

Latest file for v1.19.8:
JacksTallGrass_1.0.0.zip 1-click install


Description


Currently this mod changes two aspects about grass that I describe in greater details below.

 

1. Grass Drops

This is fairly straight forward:

Shorter grass will have a chance to not drop dry grass; Medium grass will always drop 1 dry grass; while Taller grass can drop 1-2 dry grass.

 Eaten Grass (7)  (0) Never drops dry grass.
 Very Short Grass (8)  (0.25) 25% chance of 1 dry grass.
 Short Grass (16)  (0.5) 50% chance of 1 dry grass
 Medium-Short Grass (24)  (0.75) 75% chance of 1 dry grass
 Medium Grass (32)  (1.0) Always drop 1 dry grass.
 Tall Grass (40)  (1.25) Always drop 1 dry grass, with a 25% chance to drop an additional dry grass.
 Very Tall Grass (48)  (1.5) Always drop 1 dry grass, with a 50% chance to drop an additional dry grass.

I was simply annoyed that short and tall grass dropped the same amount of dry grass.  This is based on thier draw height.

 

 

2. Grass Growth

Spoiler!

To me, this part of the mod is more of a proof of concept, as I won't claim to understand how grass in the game works in general, but I will simply state my observations in the json code and in-game.

In an unmodded game, grass is fairly static except in a couple of instances.  One instance is if the player cuts grass to an "eaten" state.  After 200 in-game hours, it will grow back to medium height.  Simple.

I altered this same mechanic to allow it to grow in stages instead.  Eaten will now grow into Very Short Grass, and that will grow into Short Grass, continuing until it is Very Tall Grass.  I have set the interval to be about 50 in-game hours between each stage.   So it will take at least 300 in-game hours (12.5 in-game days) for Eaten Grass to grow into Very Tall Grass.

I tested several worlds to see how this would affect it, both in instances and performance-wise.  I will claim the fact that I'm not very adapt at running performance diagnostics, and will simply state the following as my observation. 

In short, World generated grass does not seem affected by this.  Only grass that were cut to an eaten state and grass that newly spawned on "disturbed" soil seemed to inherit the code I established.

In normal testing, I generated new survival worlds to first observe if grass grew in general.  After I concluded that it didn't, I took notice to my system resources using task manager, switching between my large mod list to a more vanilla setup.  In short, I couldn't discern any slowdown or studderings traced to this mod.  (I did have the game max out my 16GB of RAM at one point, but the logs indicate this is likely caused by Butchering and Detailed Animals butting heads and creating constant errors related to animals).

In a more extreme test, I created a creative flat world, placed as much eaten grass around me as I could (at least 300 blocks in each direction, the paintbrushtool is good for this), and fast forward time.  There was no significant RAM usage when grass updated in growth, just a temporary 10% bump in CPU, but this is likely normal with advancing time rapidly.

 

FAQ / TL;DR about Grass Growth

Spoiler!

Would this cause very tall grass to be everywhere?  That would be annoying.

No, it seems to only affect grass that are disturbed directly (cut to an eaten state) or in-directly (grass that newly spawns on recently placed or fallen dirt) by the player(s).  So if anything, your yard is the one at risk if you don't keep it trimmed.  :)

 

Would this affect performance in any way?

It seems unlikely, or at least only marginally if at all.  My tests, in both an largely unmodded and heavily modded environment, did not show any significant increase in hardware resources, including RAM due to this mod.  This is likely due to the previous.  However, I possess an above average computer build (Ry5 5600X, RTX4060, 16GB RAM at time of testing), so its possible weaker systems may notice something.

 

When and how will grass grow?

Grass will progress in their growth stage about every 50 in-game hours (just over 2 days).

Just like in vanilla, grass won't grow in tempatures under 8 degrees, and will entirely reset their timer under -1 degrees.

 

 

Compatibility


Should be compatible with most mods unless they make similar changes here.

List of mods this works just fine with:

  • Natural Trail Mod - trampled grass will regrow over time.
  • Wildgrasses - compatible, as it doesn't edit vanilla grass.

 

Customization


I have divided the changes into two seperate json files that are labeled appropriately.  If you don't want my growing grass for any reason, delete "tallgrass-grow.json" file from the zip folder.  Likewise if you want growth but not the drops, delete the "tallgrass-drops.json" file from the zip folder.

If you want to tweak any values, I encourage you to simply open up the appropriate json file with any text editor (after extracting them) and change it to your heart's content (and replace them back in the zip folder).

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.0.0 502 Oct 21st at 10:28 PM Show JacksTallGrass_1.0.0.zip Install now

10 Comments (oldest first | newest first)

💬 JackRobAuthor, Oct 26th at 5:19 PM

Beanz

On initial inspection: Yes, it is compatible.  But if you're asking if it makes his new Wildgrasses grow in stages (if it doesn't already): No it does not.

💬 Beanz, Oct 26th at 4:13 PM

Is this compatible with the Wildgrass mod?

💬 jayu, Oct 25th at 12:30 AM

You are right, from previous experience worldgen does not place block entities unless something custom is done, I suspect wild crops do not have block entities for the same reasons, they grow with server ticks

💬 JackRobAuthor, Oct 24th at 11:33 PM

jayu

That was kind of my deduction for the most part.  Just to clarify though, when you say "newly generated", in this case doesn't seem to include grass initially generated by the world, even if you create a new world with the mod enabled.  It might be hard-coded that way for performance or other reason, but I haven't even begun to take a look at the game's code,  as I still learning/seeing what I can do with json patching alone.  Honestly, I wouldn't want it to necessarily affect all grass in the world and am happy with the way it's currently set up.  At least until I'm sure I can restrict the max height to certain climates, as I think it would be odd to find tall grass everywhere, especially in those arid/barren areas.  You are correct that if it can be done, it would have to be coded to do so, but for now, I'm content with what I have here personally.

💬 jayu, Oct 24th at 8:57 PM

The reason other grass isn't affected is that you are changing the blockentity, but blockentities already present in the world will not change, only ones that are newly generated. You would probably need code to make this affect previously placed grass. 

💬 JackRobAuthor, Oct 23rd at 1:18 AM

Svela

After playing around with Natural Trail Mod, I can answer your questions.  To both questions, Yes.  Both players and animal trampled grass (if enabled in configs) will regrow by stages instead with my mod installed, since the eaten grass produced by trampling works off the vanilla behavior (grows directly to medium height after 200 in-game hours), which is what I change here.  In other words, this is a mod I would say is completely compatible and even compliment each other.

💬 JackRobAuthor, Oct 22nd at 10:56 PM

gndrneutralnoun

Did you read the part of the description labeled "Customization" just above the comments?  Unless there is something I'm unaware of, it would be at least a bit of trouble for me to learn how to utilize ConfigLib for a technically small mod.

💬 gndrneutralnoun, Oct 22nd at 6:45 PM

Is there any chance you could use ConfigLib to make it so that the part of the mod that affects grass drops is disabled? I use a different mod for that but I really want to use the grass growth mechanic.

💬 JackRobAuthor, Oct 22nd at 5:39 PM

Svela

Definetly an interesting question, and thanks for mentioning the mod, as I've been wanting to look into that one myself.  I'll do some testing later and comment later about it.

💬 Svela, Oct 22nd at 5:25 PM

I'm using a mod called Natural Trails Mod that allows entities (the player AND most other mobs) to trample the ground, creating paths as time goes by and allowing these paths to become overgrown after a period of being untrampled. This has the effect of "cutting" grass and other foliage that is walked over. Would your mod affect the grass that is trampled by the player? What about grass trampled by non-player mobs, would that grass also become tall grass?

(edit comment delete)