Mods / Newfies Block Logger
Author: Newfie
Side: Both
Created: Jul 27th at 11:50 PM
Last modified: Nov 15th at 6:41 PM
Downloads: 1413
Follow Unfollow 12
Recommended download (for Vintage Story 1.20.12, 1.21.0 - 1.21.1 and 1.21.2 - 1.21.5):
Newfies_Blocklogger_V1.2.2.zip
1-click install
BlockLogger — Mod Description & Use Guide (v0.3 code)
Blunt summary: Admin-grade logging for Vintage Story. Tracks who did what, where, and with what across blocks, containers (with item deltas), and entities. Fast radius queries. File-backed persistence with bounded memory. Now with player-relative coordinates, real-world timestamp, and hard caps for noisy radius pulls.
What it does
-
Block events:
place / break / usewith human-friendly block names. -
Container tracking: logs open events and summarizes item deltas twice (short/long). You can independently toggle adds and takes.
-
Entity interactions: records interactions with entities (and held item if present).
-
Fast radius queries: spatial index with 16×16 cell buckets. Radius output is bounded to avoid spam.
-
Persisted logs: optional file logging; on server start it can rehydrate recent history from previous log files.
Scope: Server-side only. No client install required.
Quick start
-
Drop the mod into your server
Mods/folder and restart. -
Grant staff the
blockloggerprivilege (see Permissions). -
Use the commands:
-
/blocklog— query the block you’re looking at (defaults come from config). -
/blocklog -r 8 -n 20— newest 20 entries across all blocks within radius 8 around what you’re looking at. -
/entitylog -r 16 -n 25— recent entity interactions around you/your look point.
-
Commands
All commands require the blocklogger privilege.
/blocklog (help|up|down) (-r R) (-n N)
Defaults: -r and -n come from config (DefaultRadius, DefaultDisplayCount). Prints oldest → newest.
Options:
-
help— show usage. -
up/down— shift target one block above/below the looked-at block. -
-r Rorradius R— area merge within R (clamped byMaxRadiusand capped byMaxBlocksInRadiusOutput). -
-n Nor-l N— number of lines to show (1–200).
/entitylog (-r R) (-n N)
-
Shows entity interactions near your current look/stand position.
-
-r R— search radius (clamped byMaxRadius). -
-n N— max lines to show (1–200). Global cap applies (MaxEntitiesInRadiusOutput).
Alias
-
/blockloge— alias for/entitylog.
Output chunking: Long results are auto-split across chat messages.
Permissions
-
Registers
blockloggerprivilege. Grant to trusted staff only.
Configuration (blocklogger.json)
Created on first run. New keys (legacy keys are still read; see notes below).
{
// Display & bounds
"DefaultDisplayCount": 10,
"DefaultRadius": 5,
"MaxRadius": 128,
"MaxEntriesPerBlock": 300,
"MaxBlocksInRadiusOutput": 60,
// Entities
"DefaultEntityDisplayCount": 10,
"MaxEntriesPerEntity": 300,
"MaxEntitiesInRadiusOutput": 60,
"EntityBuffer": 2000,
"EntityRadius": 8,
// Container delta logic
"RecentWindowMs": 2500, // debounce window per player+container
"ContainerDeltaFirstCheckMs": 3000, // preferred (over ShortDelayMs)
"ContainerDeltaSecondCheckMs": 12000, // preferred (over LongDelayMs)
"LogContainerAdds": true,
"LogContainerTakes": true,
// Output formatting
"UsePlayerViewCoordinates": true, // X/Z offset from the viewer instead of world spawn
"IncludeRealWorldTimestamp": true, // append [time YYYY-MM-DD HH:mm:ssZ]
"ShowTagsInChat": true, // show [BLOCK][ITEM]… etc
"ShowAbsTagInChat": true, // show [abs x,y,z]
// Files
"LogToFile": true,
"MaxFilesToLoadOnStartup": 5,
"MaxLinesPerFileOnStartup": 20000,
// Legacy (still accepted but largely display-only)
"MaxBlockLines": 10,
"MaxEntityLines": 25,
"ShortDelayMs": 3000,
"LongDelayMs": 12000
}
Key behavior changes:
-
UsePlayerViewCoordinatesshowsX/Zrelative to the command issuer’s current position; set itfalseto use world spawn. -
IncludeRealWorldTimestampappends a real UTC time tag like[time 2025-09-14 18:20:45Z]to each line. -
New hard caps:
MaxBlocksInRadiusOutputandMaxEntitiesInRadiusOutputprevent spammy radius pulls. -
Storage caps:
MaxEntriesPerBlockandMaxEntriesPerEntitybound in-memory history (oldest trimmed first). -
Container delta windows prefer
ContainerDelta*; legacyShort/LongDelayMsremain as fallback. -
Adds/takes can be independently toggled.
Legacy compatibility:
-
MaxBlockLines/MaxEntityLinesremain in the file for backward compatibility but are superseded byMaxEntriesPerBlock/DefaultEntityDisplayCountat runtime.
Log files
-
Directory:
BlockLoggerLogs/under the server data path. -
File name:
blocklog_YYYY-MM-DD_HH-mm-ss.txt(new per boot). -
Writes are batched (~1s) and drained in chunks to avoid stalls.
Startup rehydration
-
On server start, reads up to
MaxFilesToLoadOnStartupfiles. -
For each file, reads up to
MaxLinesPerFileOnStartuplines. -
A line must include
[abs x,y,z]to be indexed. Lines without it are skipped. -
Ordering for rehydrated lines uses the file’s mtime as the timestamp (the new code no longer requires
[utc …]).
Log line format (examples)
Depending on formatting toggles, a typical line looks like:
[BLOCK][ITEM] Alice placed 'stone brick' using game:stone-bricks (X/Z +12/-3) [abs 123,65,-98] on 138Y 4M 6D 09:03 [time 2025-09-14 18:03:12Z]
[CONTAINER] Bob opened 'oak chest' (X/Z +7/+1) [abs 101,65,-90] on 138Y 4M 6D 09:04 [time 2025-09-14 18:04:01Z]
[CONTAINER][ITEM][short] Bob put 3x game:flaxfibre, took 1x game:candle… (X/Z +7/+1) [abs 101,65,-90] on 138Y 4M 6D 09:04 [time 2025-09-14 18:04:04Z]
[ENTITY][ITEM] Carol interacted with 'game:sheep' using game:knife-metal (X/Z -2/+15) [abs 87,66,-70] on 138Y 4M 6D 09:05 [time 2025-09-14 18:05:31Z]
If you disable tags or absolute coords, those brackets drop from output.
How container deltas work
-
Opening a container logs
[CONTAINER] … opened 'nice-name'. -
Two snapshots are compared after First and Second delays.
-
Differences are summarized as
put/took Nx codeup to 12 items;…indicates more. -
Per-code aggregation (no per-stack attribute diffing yet).
-
Spam opens are debounced per player+container for
RecentWindowMs. -
You can suppress adds or takes via config.
Inventory detection (more robust)
-
Direct
IInventoryis used if the block entity implements it. -
Otherwise, reflection probes for an
Inventoryproperty or field (public or non-public) and uses it if it’s anIInventory. -
This improves compatibility with non-vanilla containers.
Performance & scaling
-
Memory caps:
MaxEntriesPerBlockandMaxEntriesPerEntitytrim oldest first. -
Radius caps:
MaxBlocksInRadiusOutput/MaxEntitiesInRadiusOutputbound noisy pulls. -
I/O batching: queue flush every ~1s with per-tick drain cap (~2000 lines).
Admin guidance: If RAM is tight, reduce the caps. If staff need deeper history, increase gradually.
Troubleshooting
-
“No interactions at …” — nothing recorded for that spot, or history trimmed; try a larger radius or raise caps.
-
Entity log empty — only
[ENTITY]lines appear in/entitylog(container deltas don’t). -
Old logs not loading — ensure files are named
blocklog_*.txtand contain[abs x,y,z]. RaiseMaxFilesToLoadOnStartuporMaxLinesPerFileOnStartupif needed. -
Wrong X/Z — set
UsePlayerViewCoordinates=falseto use world spawn as origin. -
Too noisy — lower
DefaultRadius,MaxBlocksInRadiusOutput, or entity caps. You can also disable adds/takes.
Security & privacy
-
Logs include player names and exact coordinates. Treat as sensitive. Restrict
blockloggerto trusted staff.
Changelog highlights
-
v0.3: player-relative coordinates, real-world timestamp, robust inventory detection, new caps & config keys, startup file limits.
-
v0.2: container deltas, entity interactions, spatial index, file rehydration, batched I/O.
-
v0.1: initial block place/break/use logging.
Credits
-
Lead development & maintainer: Newfie
If you like my mods consider clicking the donate button on top!
| Mod Version | Mod Identifier | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|---|
| 1.2.2 | newfiesblocklogger | 97 | Sep 18th at 9:52 PM | Newfies_Blocklogger_V1.2.2.zip | 1-click install | ||
Changelog[1.2.2] – 2025-09-18Added
Changed / Improved
Fixed
Performance
| |||||||
| 1.2.1 | newfiesblocklogger | 23 | Sep 14th at 6:13 PM | NewfiesBlockLogger-v1.2.1.zip | 1-click install | ||
|
player-relative coordinates, real-world timestamp, robust inventory detection, new caps & config keys, startup file limits. | |||||||
| 1.2.0 | newfiesblocklogger | 14 | Sep 14th at 3:43 PM | NewfiesBlockLogger-1.2.0.zip | 1-click install | ||
[0.2.0] - 2025-09-14Added
Changed
Fixed / Hardening
Notes / Breaking
| |||||||
| 1.1.1 | newfiesblocklogger | 36 | Aug 12th at 5:00 PM | NewfieBlockLoggerV1.1.1.zip | 1-click install | ||
v1.1.1 — Command changesAdded
Changed
| |||||||
| 1.0.1 | blocklogger | 1186 | Jul 28th at 3:01 AM | NewfiesBlockLoggerV1.0.1.zip | 1-click install | ||
|
✅ New Features
🔧 Improvements
| |||||||
| 1.0.0 | blocklogger | 57 | Jul 27th at 11:51 PM | NewfiesBlockLogger.zip | 1-click install | ||
|
first release | |||||||
I am trying to track down what seems to be an inventory related area crash. When it pops it causes all players near by to crash. I was wondering if there was any chance this could be causing the issue? The only lead I have is it seems to be inventory related but im not sure if it actually is. There are two different crash logs among the most recent group crash, all but one are the same.
Hell yeah ! Thanks Newfie !
Tisma It is coming soon :) Within next couple weeks, all my mods will be updated
Hey Newfie ! Your mods is very great for server owner !
It would be interesting to have it for 1.21 !
Its is possible ?
Thanks !
@WatermelonFrogy My server had 35 players on yesterday, and it didnt make any noticeable change to it.
All server stats like ram, and cpu were practically unchanged.
In a 6 hour window with 20-35 players online playing, it generated a 5.88mb file
So if it was 6mb/6hr x 4 =24mb/day
24x365 = 8544mb or 8.54GB on average a year and that is ASSUMING the server had 100% uptime and 30+ players all year long
How badly does this effect server performance?