[1.16.5] Count Entities For Exporting - Modder Support - Forge Forums

Jump to content View in the app

A better way to browse. Learn more.

Learn more Dismiss Close Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Forge Forums Forge Forums
  • Sign In
  1. Home
  2. Mod Developer Central
  3. Modder Support
  4. [1.16.5] Count entities for exporting
  • All Activity
Search the Forums BEFORE making a new post. Hide announcement Currently supported: All versions Hide announcement
  • Start new topic
  • Reply to this topic
silentkiller159 Tree Puncher

silentkiller159

Members
  • 1 posts
  • 0 Badges
  • 0 Reputation
silentkiller159 Tree Puncher

silentkiller159 Members

Posted August 26, 20214 yr

Posted August 26, 20214 yr

Hello there to all of you,

I am developer, but mostly in C# and Java is on the second track. I am currently hosting a Minecraft server and I wanted to monitor its performance using Grafana with prometheus database. I have found a mod which exports almost all of required data (Players, tps, jvm status etc.) I wanted to improve the mod, to export entity count as well (Old servers often were acting strangely with high entity count in some chunk loaded factory where the machine got stuck .. etc etc) I have tried to find a way of counting those entity, reading the Forge documentation didnt help me (Registering an event handler sounds strange to me, there must be some list of entities which I might be able to siply count). Is there some easy way of getting the count of all living entities? (The exporter I am trying to improve : link to Github) Thank you for the support, Silent

Edited August 26, 20214 yr by silentkiller159 typo

  • Quote
  • Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account. Note: Your post will require moderator approval before it will be visible.

    Guest Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below. Reply to this topic...
    • Submit Reply
    Share https://forums.minecraftforge.net/topic/103800-1165-count-entities-for-exporting/ More sharing options... Followers Go to topic listing IPS spam blocked by CleanTalk.

    Announcements

      New Discord server Hide announcement
    • I need some help with org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError im using terrafirmacraft TimeControl

      I need some help with org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError im using terrafirmacraft

      Nevermind. I just deleted the damn mod instead.

      By TimeControl · 11 hours ago11 hr

    • Forge 1.20.x Tutorial by Myroslav Mokhammad Abdeljawwad: Clean Capability Syncing (Server ↔ Client) Myroslav Mokhammad Abdelja

      Forge 1.20.x Tutorial by Myroslav Mokhammad Abdeljawwad: Clean Capability Syncing (Server ↔ Client)

      Hello everyone,This tutorial is a short write-up based on patterns I’ve been using while developing Forge 1.20.x mods that rely on custom capabilities and reliable server ↔ client synchronization.Author: Myroslav Mokhammad AbdeljawwadOverviewCapabilities are one of the most powerful systems in Forge, but syncing them incorrectly can easily lead to desyncs, performance issues, or unexpected client behavior. This guide focuses on a clean, minimal approach that scales well.### Step 1: Defining the CapabilityDefine your capability interface and implementation as usual. Keep the data minimal and serializable.Key tip:Avoid putting logic in the capability itself. Treat it as a data container.### Step 2: Attaching the CapabilityAttach the capability during the appropriate lifecycle event (e.g. AttachCapabilitiesEvent). Make sure this is done consistently on both logical sides.Step 3: Sync StrategyInstead of syncing on every tick, sync only when:- The data changes- The player logs in- The chunk or entity loadsUsing a SimpleChannel packet with explicit encode/decode logic gives you the most control and avoids unnecessary traffic.Step 4: Client HandlingOn the client side:- Never trust local state blindly- Apply updates only after packet validation- Keep rendering logic separate from data updatesFinal NotesThis pattern has worked well for larger mods where performance and stability matter. If you’re building long-term Forge projects, keeping syncing explicit and event-driven will save a lot of debugging time.I’ll update this tutorial if Forge introduces changes to capability handling in future versions.Thanks for reading, and I hope this helps other modders.

      By Myroslav Mokhammad Abdelja · Posted 19 hours ago19 hr

    • recipes json change from 1.21.1 dont work on newer version Myroslav Mokhammad Abdelja

      recipes json change from 1.21.1 dont work on newer version

      You might want to check how you’re registering the capability provider — this often causes the issue you’re describing.I ran into something similar recently while working on a Forge 1.20.x mod. Making sure registration happens at the correct lifecycle event fixed it for me.— Myroslav Mokhammad Abdeljawwad

      By Myroslav Mokhammad Abdelja · 19 hours ago19 hr

    • New modder introduction + first Forge 1.20.x project Myroslav Mokhammad Abdelja

      New modder introduction + first Forge 1.20.x project

      Hi everyone,My name is Myroslav Mokhammad Abdeljawwad and I’m new to posting here, though I’ve been working with Forge for a while.I’m currently experimenting with a Forge 1.20.x mod focused on custom events and server-side logic. I’m comfortable with Java, Gradle, and debugging mixin-related issues, but I’m still learning best practices around capabilities and data syncing.I’m hoping to both learn and contribute here as I continue developing mods and tools around the Forge ecosystem.Looking forward to being part of the community.

      By Myroslav Mokhammad Abdelja · Posted 19 hours ago19 hr

    • Orbital strike cannon fishing rod mod Stonecold123

      Orbital strike cannon fishing rod mod

      RIP. 2025-2025. Last seen. 4 weeks ago prob idk.

      By Stonecold123 · Yesterday at 05:03 AM1 day

    Who's Online (See full list)

    • There are no registered users currently online
    1. Home
    2. Mod Developer Central
    3. Modder Support
    4. [1.16.5] Count entities for exporting
    • All Activity

    Important Information

    By using this site, you agree to our Terms of Use.

    I accept
    • Sign In
    • Sign Up
    • Search
    • Menu
    Close panel
    • Existing user? Sign In
    • Sign Up
    Close panel
    • Files
    • Docs
    • Discord
    • Browse
      • Forums
      • Staff
      • Online Users
      • Leaderboard
    • Activity
    1. Home
    2. Mod Developer Central
    3. Modder Support
    4. [1.16.5] Count entities for exporting
    Close panel Search Where: Everywhere This Forum This Topic Topics Members Search: Content titles and body Content titles only Date Created: Any date Past 24 hours Past week Past month Past six months Past year Use: All of these words Any of these words Last Updated: Any date Past 24 hours Past week Past month Past six months Past year Search... Search Everywhere This Forum This Topic Topics Members Find results in Search titles and body Search titles only Date Created Created any time Created past 24 hours Created past week Created past month Created past 6 months Created past year Last Updated Updated any time Updated past 24 hours Updated past week Updated past month Updated past 6 months Updated past year Close

    Configure browser push notifications

    close Chrome Safari Edge Firefox
    Chrome (Android)
    1. Tap the lock icon next to the address bar.
    2. Tap Permissions → Notifications.
    3. Adjust your preference.
    Chrome (Desktop)
    1. Click the padlock icon in the address bar.
    2. Select Site settings.
    3. Find Notifications and adjust your preference.
    Safari (iOS 16.4+)
    1. Ensure the site is installed via Add to Home Screen.
    2. Open Settings App → Notifications.
    3. Find your app name and adjust your preference.
    Safari (macOS)
    1. Go to Safari → Preferences.
    2. Click the Websites tab.
    3. Select Notifications in the sidebar.
    4. Find this website and adjust your preference.
    Edge (Android)
    1. Tap the lock icon next to the address bar.
    2. Tap Permissions.
    3. Find Notifications and adjust your preference.
    Edge (Desktop)
    1. Click the padlock icon in the address bar.
    2. Click Permissions for this site.
    3. Find Notifications and adjust your preference.
    Firefox (Android)
    1. Go to Settings → Site permissions.
    2. Tap Notifications.
    3. Find this site in the list and adjust your preference.
    Firefox (Desktop)
    1. Open Firefox Settings.
    2. Search for Notifications.
    3. Find this site in the list and adjust your preference.

    Tag » How To Count Entities In Minecraft