Mods / The Nightwatcher

Tags: #Creatures #QoL #Utility
Author: Buggi
Side: Both
Created: Nov 16th 2021 at 6:29 AM
Last modified: Jan 30th at 7:42 PM
Downloads: 15705
Follow Unfollow 180

Recommended download (for Vintage Story v1.20.x):
NightWatcher-1.20-2.2.0.zip  1-click install


Once placed the Nightwatcher prevents Entities from spawning in a radius around it. You decide what he watches for in the watcher_config.json. By default he blocks drifters, bears, and wolves. Add/remove Entity code values of anything you wish to block.

An example is in Vintagestory\assets\survival\entities\land there's a locust.json, inside that file is code: "locust"

"locust" is the value you would add to the watcher_config list to block all the variants of locusts from spawning in the radius.

The radius is configurable, Default radius is 128.

v2.2 For game version 1.20.3

DEFAULT entity blocking now has more entity codes in it. Delete your old watcher_config.json file in ModConfig to regenerate the new list. Or you can add the new codes yourself if you've already customized the list.

A list of all entity codes blocked by default now:

  • drifter
  • bell
  • locust
  • bear
  • wolf
  • bellmini - new type in 1.20
  • erel - new type in 1.20
  • bowtorn - new type in 1.20
  • shiver - new type in 1.20

 

v2.0 MAJOR FEATURE - Now can block Rifts from spawning in the effective radius! 
Blocking Rifts does so no matter if there's a storm or not. If you wish for storms to allow Rifts anywhere, let me know.

v1.6 MAJOR FEATURE - Now can block ANY entity as long as you put the code part in the config.

"BlockCodes" is an array that defaults to this:
"BlockCodes": [
"drifter",
"bear",
"wolf"
],

All you need to do is add/remove the first code part of the entity you wish to block with the Nightwatcher. (See above)
This will still respect "BlockDuringStorm" and shut down all entity blocking during a Temporal Storm if this is false.

You may catch him looking around once in awhile, don't be alarmed, he remains steadfast in his duties.

Crafting requires a temporal gear, a straw dummy, and gold plate. So not an early game option.

As always, my YouTube channel is dedicated to moddable games and VS is just plain fun to mod and play. 
Check out my channel here:
https://www.youtube.com/c/FlexibleGames

I'm always on the lookout for mod ideas.
Support me if you want via Patreon: https://www.patreon.com/flexiblegames

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v2.2.0 3417 Jan 30th at 7:42 PM Show NightWatcher-1.20-2.2.0.zip 1-click install
v2.1.0 2775 Mar 21st 2024 at 4:02 AM Show NightWatcher-119-2.1.0.zip 1-click install
v2.0.0 463 Mar 7th 2024 at 7:57 PM Show NightWatcher-1.19-2.0.zip 1-click install
v1.8.0 131 Mar 7th 2024 at 5:37 PM Show NightWatcher-1.19-1.8.zip 1-click install
v1.7.0 563 Feb 16th 2024 at 10:30 PM Show NightWatcher-1.19-1.7.zip 1-click install
v1.6.0 516 Feb 5th 2024 at 6:14 PM Show NightWatcher-1.19-1.6.zip 1-click install
v1.5.0 1443 Aug 28th 2023 at 4:24 PM Show NightWatcher-1.18-1.5.zip 1-click install
v1.4.0 1747 Apr 10th 2023 at 9:11 PM Show NightWatcher-1.18-1.4.zip 1-click install
v1.3.0 1588 Aug 31st 2022 at 8:13 PM Show NightWatcher_v1.3.0.zip 1-click install
v1.2.0 2094 Jan 11th 2022 at 3:49 AM Show NightWatcher-v1.2.zip 1-click install
v1.1.0 553 Nov 17th 2021 at 6:51 PM Show NightWatcher-v1.1.0.zip 1-click install
v1.0.0 415 Nov 16th 2021 at 6:30 AM Show NightWatcher-v1.0.0.zip 1-click install

48 Comments (oldest first | newest first)

💬 Buggi , 5 hours ago

You want to customize what it blocks individually? That would require a ton of work.

💬 Kara, May 15th at 5:01 AM

Would you be able to add a second version in? more or less just having two of them both customizable? had a thought for my server if i had two versions i could set one for animals and one for drifters. (we had to disable drifters, cause players were using them to cheese dungeons on the map >.<) 

💬 Buggi , Mar 21st at 7:54 PM

All you need to use in the config is the first 'name' or 'code' of the entity.

 

For example, adding "wolf" to the list (it's already there) blocks wolf-male, wolf-female, wolf-pup variants, etc.

Same with "drifter", drifter-surface, drifter-nightmare, etc. 

Once you understand how the game maps things, it makes sense and is very intuitive. 

 

"BlockCodes" in the config was poorly named on my part, it is the CODE of the Entity to BLOCK, NOT a code OF a block. Can't change it now, everyone who uses this would have to redo their configs.

💬 Menelos, Mar 21st at 7:09 PM

Buggi Thanks for this nice mod. is it possible to use wilcards? The Rustbound Magic mobs have many variants and that would make things easier (IIRC there's 8 variants for each mob, 3 being common, the rest are bosses and will not spawn at random places, so that's 24 instead of 3 lines, and that would be future-proof because some variants are curently disabled but might be activated later on).

💬 Ryumachinae, Mar 17th at 4:56 PM

I see, thank you for the info I'll let them know.

💬 Buggi , Mar 16th at 6:54 AM

Your using a rift alteration mod and it's causing crazy Rift spawning behavior?

If so, that mod needs to gracefully handle the rift spawn event returning false. All the nightwatcher does is subscribe to the event, detect the distance to the watcher (as well as the config value) and return false if it should block it. That's it.

💬 Ryumachinae, Mar 16th at 12:43 AM

I got a server crashing cascade of errors, apparently the game continuously tried spawning a rift nearby, but the Nightwatcher prevented it. But then it kept occuring over and over until it crashed the server. Is this an issue on your end? Or does changing rift spawning behaviour from using Temporal Tempest cause this? Who should I talk to about fixing it?

💬 WeatherAlchemy, Mar 14th at 3:14 AM

Me again with another idea, though this one is... maybe more useful and less silly? Maybe?

 

Would it be possible to have more than one recipe for the Nightwatcher so that we could set different recipes to block different entities? Ex. Recipe 1 blocks entities a, b, c, and d; Recipe 2 blocks a, c, d, and e, but NOT b?

Strange as it may sound, I want to block some animals from spawning inside of my farm, but I don't mind if Drifters spawn inside of it.

💬 Buggi , Mar 13th at 6:21 PM

You can shrink the radius of the NightWatcher using the config file watcher_config to test your pack.

💬 Ryumachinae, Mar 12th at 3:08 AM

I disagree wholeheartedly, enemies spawning outside a protected zone and attacking in is EXACTLY the behavior I want. I am trying to develop a modpack that resembles 7 days to die, and that requires being able to "clear territory" of enemies so that they have to attack from OUTSIDE your controlled territory. Pairing this with Temporal Tempest mod can potentially create the gameplay I am looking for. Plus I use the Bed Spawning mod, which reduces the uses of the Temporal gear, so having them be used for creating these is ideal. The fact the Nightwatcher is an "entity" is also good, because then that hopefully means that hostile mobs could see it as an attackable entity and possibly try to destroy it in order to allow more hostile mobs to spawn deeper within a player controlled territory. There is a LOT of potential here.

As for being able to see the range, that is unfourtunate. How else would someone effectively tell if what they are trying to protect is protected? other than waiting for enemies to spawn.

I havent really used any of the "land claim" mods as they dont explicitly state that it stops enemy mobs from spawning within the territory. If they do I may switch. But for now I am likely to remove the plate entirely and simply reduce the effective range of the nightwatcher, to make it something you have to gradually build up a "controlled territory".

💬 Buggi , Mar 12th at 12:37 AM

Smaller radius would be largely ineffectual as anything that spawns would automatically target you. So an entity would spawn outside a range of, say 32, target you and attack thus making the closer spawn block irrelevant. The gold plate was used precisely because it is difficult to get, I don't think this is something you should have access to early. You have to go through some tough times to truly enjoy the good ones. :) But as always, you can create a patch mod to edit the values and recipe and I included a config you can use to further customize it.

Rendering the radius of this thing would literally destroy your FPS, it's a sphere 128 blocks in radius, it's massive, default radius of 128, it would have to highlight 206000 blocks at a minimum. 

💬 Ryumachinae, Mar 11th at 8:59 PM

Fine mod, kind of a lite-land claim system. However I find the gold plates to be far too restrictive, I would LOVE if you would add different nightwatchers that have different radius based on the plate theyre on. Copper plated nightwatchers could have a much smaller radius but be far more accessible.

Also, being able to SEE the exact radius of protection would be incredibly useful, thanks!

💬 Buggi , Feb 24th at 8:03 PM

I currently don't clamp the radius value, odd. Might have unknown behavior if extremely large values are used for the radius.

💬 Hunterhawk, Feb 22nd at 2:16 PM

Hello, I wanted to know what is the maximum radius of the night watcher? Does it depend on the Chunks loading range in the game?

💬 Buggi , Feb 20th at 9:35 PM

Never enough features.

💬 WeatherAlchemy, Feb 20th at 8:33 AM

I know this is a completely impractical suggestion, but the idea of being able to make a version of the Night Watcher that is tiny and functions like the other ¼ block objects sounds REALLY funny and cute. Like... The Night (stand) Watcher.

 

Or a version of the full size/mini Watcher that also functions as a lantern.

 

Tbh, being able to generally customize them— idk, dyeing them, or putting clothes on them— is way more appealing to me than it should be. I know that those are some hugely impractical ideas, so I'm more just letting you know that I am, apparently, weirdly attached to them.

 

That said, on an actually relevant/mechanical side of things, allowing Temporal Storms to overwrite some/all blacklisted spawns would be interesting. I guess if would be something like a "Temporal Storm Whitelist"? "If weather= Temporal storm, then allow: (insert whatever entities/rifts.)"? So you could have Temporal Storms only overwrite the ability for rifts and/or drifters to spawn but not allow wolves to spawn (can they even spawn in a TS...?) Or have it where they just completely nullify the little buddy.

 

Anyway, thank you for the mod!

💬 Buggi , Feb 18th at 9:32 PM

Check your config file and make sure "wolf" is part of the list.
Outside of that, the game could be spawning them outside of the event call-back function and completely by-passing the system. 

💬 Kara, Feb 16th at 3:24 AM

This does not appear to be working in 1.20.4 (at least its not preventing wolf spawns in our spawn area, i placed like 20 around the area.)
no errors to speak of, just figured i would let you know >.<

💬 ergoplato, Jan 31st at 12:04 AM

Thank you very much for all of the updates, Buggi!

💬 Buggi , Jan 30th at 7:50 PM

Updated, enjoy!

💬 Buggi , Jan 28th at 11:57 PM

Just updated the Angel Belt, this is next on the list!

💬 Cid69, Jan 28th at 1:59 PM

Hi Buggi

Loving the Nightwatcher mod, it is allowing builds that can use light and shadow as building materials without having to worry about unwelcome guests.

As 1.20.3 stable is now out, do you have any idea of when we can expect an update, as I am waiting on this mod as well as a couple of other to update so we can migrate our server.

Thanks

Cid

💬 Buggi , Dec 13th 2024 at 7:30 PM

Yep, waiting on a stable version to update, and it's the holidays so the timing is not great with family events and everything.

💬 Freeflier, Dec 9th 2024 at 6:09 AM

Would love to see an update to 1.20!

💬 blueblynd, Apr 12th 2024 at 5:30 AM

Love this mod! A note for fellow users is to try to remember how realistic Vintage Story's ecosystem strives to be - a lacking of wolves in the area has quickly led to an antlike overabundance of hares swarming my house, so you might have to be prepared to add multiple animals to the block list until you're essentially pausing the food chain in that radius xD

(Also wanted to thank you for not giving the Night Watcher the tendency to migrate like most of the other dummy(?)-based items seem to do. It's annoying enough trying to keep my scarecrow near the garden it's supposed to be protecting; I can't imagine needing to track these guys down!)

Very cool work, thank you!!

💬 Buggi , Mar 30th 2024 at 4:28 AM

Circle

Calculation is based on distance between the entity and the nightwatcher, essentially a bubble around it.

💬 SecretFoxfire, Mar 26th 2024 at 3:57 PM

Love this mod, couldn't play without it. A question, though: Is the protected area a circle or a square? I'd been assuming it was a 256x256 square, but someone pointed out to me that "radius" might imply a circle, in which case the protected area is smaller than I realized and I'll need to adjust their position to ensure coverage. Thanks!

💬 Buggi , Mar 7th 2024 at 7:59 PM

version 2.0 now includes the feature I've wanted to do for awhile, and that's the ability to also block Rifts from spawning in the EffectRadius of the NightWatcher.

Make sure to delete your old watcher_config.json file in ModConfig to regenerate the default file. Sorry about this, for some reason the config loading process doesn't detect changes to variables, if someone knows how to do this please let me know.

💬 Buggi , Feb 19th 2024 at 6:51 PM

@Kara

"Assembly with same name is already loaded" kind of gives it away there. Did you not delete the old version?  The game does cache some data so that might be the issue.


And it'll only create the config file if the file is missing. This is purely base-game modding API I'm using, nothing special. watcher_config.json is the filename it creates.

💬 RikeiR, Feb 18th 2024 at 2:37 AM
💬 Kara, Feb 17th 2024 at 12:09 AM

Buggi 
16.2.2024 19:05:04 [Error] [nightwatcher] An exception was thrown when trying to load assembly:
16.2.2024 19:05:04 [Error] [nightwatcher] Exception: Assembly with same name is already loaded
at System.Runtime.Loader.AssemblyLoadContext.g____PInvoke|5_0(IntPtr ptrNativeAssemblyBinder, UInt16* ilPath, UInt16* niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Vintagestory.Common.ModAssemblyLoader.LoadFrom(String path) in VintagestoryLib\Common\API\ModAssemblyLoader.cs:line 34
at Vintagestory.Common.ModContainer.<>c__DisplayClass35_0.b__0(String path) in VintagestoryLib\Common\API\ModContainer.cs:line 449
at System.Linq.Enumerable.SelectListIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
at Vintagestory.Common.ModContainer.LoadAssembly(ModCompilationContext compilationContext, ModAssemblyLoader loader) in VintagestoryLib\Common\API\ModContainer.cs:line 448

It also appears to not be creating a config file via single player. 

Edit: by deleting ALLL of my moddata files, it seems to have fixed this issue. that being said, im not sure which file was for your mod and deleting them all on a server is not an option =P. 

💬 Buggi , Feb 16th 2024 at 10:30 PM

Thanks for reporting the issue! All should be fixed now! <3

💬 Buggi , Feb 16th 2024 at 9:21 PM

Will investigate! Thanks for reporting!

💬 Kara, Feb 8th 2024 at 12:52 AM

ASkeleton Our server is experiancing the same issue. i think we are going to revert back to v1.5.0 (1.18.5) as it worked just fine in 1.19. Buggi

💬 ASkeleton, Feb 7th 2024 at 4:44 AM

It doesn't seem to be stopping the drifters from spawning at all. Am I missing something?

💬 Kara, Feb 5th 2024 at 6:23 PM

Instantly downloading this, for our server <3. love everything you do =D

💬 Buggi , Feb 5th 2024 at 6:14 PM

Just Updated:

MAJOR FEATURE - Now can block ANY entity as long as you put the code part in the config.

"BlockCodes" is an array that defaults to this:
"BlockCodes": [
"drifter",
"bear",
"wolf"
],

All you need to do is add/remove the first code part of the entity you wish to block with the Nightwatcher. 
This will still respect "BlockDuringStorm" and shut down all entity blocking during a Temporal Storm if this is false.

💬 Mendall, Feb 2nd 2024 at 12:34 AM

anyone know if this is working in 1.19?

 

💬 Buggi , Aug 28th 2023 at 4:24 PM

Many thanks for the help fixing this! I've been extremely busy the last couple months so fell behind on updating all these.

💬 Kara, Aug 10th 2023 at 9:48 PM

on version 1.18.8 Fixed Fixed this little guy, on version 1.18.8 


Open nightwater.zip most updated > assets > game > shapes > Entity > Edit the nightwatcher.json file inside. replace the Textures into with what is provided. some of the directed texture's were changed for the strawdummy in vanilla. if the mod dev ever see's this, You are welcome. 
SecretFoxfire

    "textures": {
        "gold": "game:item/resource/plate/gold",
        "face": "game:block/hay/strawdummy/face",
        "tinbronze": "game:entity/humanoid/serapharmor/scale/tinbronze",
        "agedwood": "game:block/hay/strawdummy/agedwood",
        "bamboo-side": "game:block/hay/bamboo-side",
        "bamboo-top": "game:block/hay/bamboo-top"
    },
💬 SecretFoxfire, May 29th 2023 at 6:25 PM

Thank you so much for this mod. Fair and balanced (gold is so hard to find!) but also really necessary for making areas habitable in the long-term.

I have noticed that the texture is broken on 1.18.5 though. It looks fine while carrying it around but once placed the poor thing's face is a question mark 😅

💬 Buggi , Apr 10th 2023 at 9:14 PM

Updated to 1.18, and yes, now can prevent bear spawns.

💬 Buggi , Mar 30th 2023 at 6:12 PM

Now there's bears? Do they really spawn frequently enough to justify adding them?

💬 Kara, Mar 20th 2023 at 6:53 AM

able to add bears? xD
would do it myself, but im not sure how to code yet D=

💬 Buggi , Aug 31st 2022 at 8:14 PM

Updated to 1.17

Added config option for Blocking Wolves
Added config option for Blocking Drifters (So you can JUST block wolves if you want)..
Added config option to control blocking of drifters during temporal storms.

💬 Fank, Apr 15th 2022 at 6:30 PM

How about a nightwatcher addon that disables wolf spawns?

💬 Buggi , Nov 16th 2021 at 6:20 PM

While it could be done, you can already tweak the radius by editing the watcher_config.json. I didn't want to be able to craft this too early as the early game should be harder.

💬 Polraudio, Nov 16th 2021 at 4:33 PM

Very Nice! This is almost the exact mod i was looking for. Dont suppose you could make different tiers?

Copper:
Does a 32 block area.

Bronze:
Does a 64 block area.

Iron:
Does a 128 block area.

Steel:
Does a 256 block area.

Steel, Gold and Temporal Gears:
Does a 512 block area.

 (edit comment delete)