Marlim Posted August 10, 2021 Report Share Posted August 10, 2021 If I mown the lawn of my yard it will one day grow back...but that doesn't happen in the game. My suggestion is that the grass grows over time, Stardew Valley or Terraria style, in spring, after the winter and snow. 1 1 Link to comment Share on other sites More sharing options...
LuuBluum Posted August 11, 2021 Report Share Posted August 11, 2021 It does. The wiki is wrong in this regard; grass grows and regrows over time just fine. Link to comment Share on other sites More sharing options...
Marlim Posted August 11, 2021 Author Report Share Posted August 11, 2021 12 hours ago, LuuBluum said: It does. The wiki is wrong in this regard; grass grows and regrows over time just fine. How does it grow? Link to comment Share on other sites More sharing options...
LuuBluum Posted August 11, 2021 Report Share Posted August 11, 2021 39 minutes ago, Marlin said: How does it grow? Simple. public override void OnServerGameTick(IWorldAccessor world, BlockPos pos, object extra = null) { base.OnServerGameTick(world, pos, extra); GrassTick tick = extra as GrassTick; world.BlockAccessor.SetBlock(tick.Grass.BlockId, pos); if (tick.TallGrass != null && world.BlockAccessor.GetBlock(pos.UpCopy()).BlockId == 0) { world.BlockAccessor.SetBlock(tick.TallGrass.BlockId, pos.UpCopy()); } } Whenever it receives a server game tick, and specifically is told to grow grass in that tick, then it grows grass. Of course, that begs the question: when should it receive a server game tick? public override bool ShouldReceiveServerGameTicks(IWorldAccessor world, BlockPos pos, Random offThreadRandom, out object extra) { extra = null; if (offThreadRandom.NextDouble() > growthChanceOnTick) return false; if (growOnlyWhereRainfallExposed && world.BlockAccessor.GetRainMapHeightAt(pos) > pos.Y + 1) { return false; } bool isGrowing = false; Block grass; BlockPos upPos = pos.UpCopy(); bool lowLightLevel = world.BlockAccessor.GetLightLevel(pos, EnumLightLevelType.MaxLight) < growthLightLevel; if (lowLightLevel || isSmotheringBlock(world, upPos)) { grass = tryGetBlockForDying(world); } else { isGrowing = true; grass = tryGetBlockForGrowing(world, pos); } if (grass != null) { extra = new GrassTick() { Grass = grass, TallGrass = isGrowing ? getTallGrassBlock(world, upPos, offThreadRandom) : null }; } return extra != null; } Which is to say, first it rolls a die to see whether it should even grow, based on growth chance. Then it checks whether it should be getting rain and, if it should, whether it does. If all of that is met, it then checks whether or not the grass should grow or die (die if smothered or in darkness, grow otherwise). If in fact it should, then it does. So, if you want grass to grow, make sure it is exposed to rain and not smothered, and is in good lighting. Then wait. Link to comment Share on other sites More sharing options...
Streetwind Posted August 11, 2021 Report Share Posted August 11, 2021 (edited) Grass plants have a chance to spawn whenever the texture of a dirt block changes. Freshly placed dirt blocks have no grass texture at all. Then, over time, their texture can go from patchy to sparse to full. Sometimes it skips a step, sometimes it does every step. Sometimes it happens quickly, sometimes it takes a while. Everytime the texture changes, it has a chance (but not a guarantee) to spawn a grass plant on top of it. If there already is one, the block texture can still continue to change, but it will obviously not spawn new grass, as it is already there. But if the grass plant is harvested, a new one might spawn at the next texture change. Once the dirt block has reached its final, full grass texture, it will never change again, and therefore, never spawn grass again. Unless you dig it up and place it back down so it starts texture-less again. Also, fallow farmland has a small chance of spawning grass over time. If you want a steady supply of grass without having to regularly dig up dirt, make a giant field, and don't plant anything on it. Doing the dirt thing generates grass much faster, though. Edited August 11, 2021 by Streetwind Link to comment Share on other sites More sharing options...
LuuBluum Posted August 11, 2021 Report Share Posted August 11, 2021 3 minutes ago, Streetwind said: Grass plants have a chance to spawn whenever the texture of a dirt block changes. Freshly placed dirt blocks have no grass texture at all. Then, over time, their texture can go from patchy to sparse to full. Sometimes it skips a step, sometimes it does every step. Sometimes it happens quickly, sometimes it takes a while. Everytime the texture changes, it has a chance (but not a guarantee) to spawn a grass plant on top of it. If there already is one, the black texture can still continue to change, but it will obviously not spawn new grass, as it is already there. But if the grass plant is harvested, a new one might spawn at the next texture change. Once the dirt block has reached its final, full grass texture, it will never change again, and therefore, never spawn grass again. Unless you dig it up and place it back down so it starts texture-less again. Also, fallow farmland has a small chance of spawning grass over time. If you want a steady supply of grass without having to regularly dig up dirt, make a giant field, and don't plant anything on it. Doing the dirt thing generates gradd much faster, though. Ah, you are actually right on that. I guess that's to prevent tall grass spam, since otherwise over time fields of grass would become completely overgrown with tall grass. Perhaps that really means that we just need more wildlife to eat the ever-growing tall grass? 2 Link to comment Share on other sites More sharing options...
Maelstrom Posted August 11, 2021 Report Share Posted August 11, 2021 (edited) 1 hour ago, Streetwind said: Also, fallow farmland has a small chance of spawning grass over time. If you want a steady supply of grass without having to regularly dig up dirt, make a giant field, and don't plant anything on it. Doing the dirt thing generates grass much faster, though. Or find a plain that is littered with tall grass. Dropped my permanent home in the middle of a massive field of tall grass. Literally every single block in a hundred block radius has tall grass unless there's a tree, water, or reed on it. I wonder how long my iron scythe will take to break harvesting only grass and how much grass will I have on my hands when it does. Edited August 11, 2021 by Maelstrom Link to comment Share on other sites More sharing options...
shnabbles Posted August 16, 2023 Report Share Posted August 16, 2023 I'm actually interesting in preventing grass from growing back. Is there a method to this? Or even a mod? Link to comment Share on other sites More sharing options...
Maelstrom Posted August 16, 2023 Report Share Posted August 16, 2023 Since the last post in August, Tyron has changed the game mechanics for grass and especially the scythe. Turn on the remove mode for the scythe and harvest the grass. Tall grass will not grow on the harvested block unless you remove the soil block and replace it, otherwise you'll have a nicely manicured lawn. Link to comment Share on other sites More sharing options...
Thorfinn Posted August 16, 2023 Report Share Posted August 16, 2023 You can also just break the grass with something other than a knife or scythe, or use your knife twice, once to cut the grass, once to remove the "(Eaten)" grass. Keep in mind the point @Streetwind made -- until all the once-bare dirt blocks say "(Grassy)", there is a chance grass will spawn on them. Link to comment Share on other sites More sharing options...
ArgentLuna Posted August 21, 2023 Report Share Posted August 21, 2023 I wish I could encourage the grass to grow back (and shrubs I wish) ~ had a bit of a incident with a pit kiln and the plain i live near is very plain now Link to comment Share on other sites More sharing options...
Streetwind Posted August 21, 2023 Report Share Posted August 21, 2023 2 hours ago, ArgentLuna said: I wish I could encourage the grass to grow back (and shrubs I wish) ~ had a bit of a incident with a pit kiln and the plain i live near is very plain now You can. Grab a shovel, dig up the top layer of dirt, and place it back down. As time passes and the dirt begins to green, it will spawn tall grass above it. Shrubs, unfortunately, will not grow back this way. If you really want them, you could hop into creative mode and grab some leaf blocks to place down... 1 Link to comment Share on other sites More sharing options...
ArgentLuna Posted August 22, 2023 Report Share Posted August 22, 2023 Good to know, something do do then in spring Link to comment Share on other sites More sharing options...
Marlim Posted August 22, 2023 Author Report Share Posted August 22, 2023 If you completely clear a large area, the plants will not grow back ever again, which is quite unrealistic as nature if unchecked would grow until it overwhelms your house, giving the impression of an abandoned house. Link to comment Share on other sites More sharing options...
Recommended Posts