…","url":"https://mcmodshub.com/mod/39370","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/DownloadAction","userInteractionCount":2009}},{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"How do I install mc-player-counter | Displays the number of online players with 2 lines of HTML?","acceptedAnswer":{"@type":"Answer","text":"Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. Download the .jar. Put it in the .minecraft/mods folder and launch that loader profile. Opens on Spigot — not every file is mirrored on our own servers."}}]}]
Home›Java›Mods›mc-player-counter | Displays the number of online players with 2 lines of HTML
ModsJava

mc-player-counter | Displays the number of online players with 2 lines of HTML

Minecraft Java mod. Download on the author's site.

⬇ Download on Spigot
You just need to add the script link (you can add in head or body)

Code (Text):

<script src="https://cdn.jsdelivr.net/gh/leonardosnt/ [email protected]/dist/mc-player-counter.min.js"></script>
 
Then create an element with data-playercounter-ip="IP" ( See attributes)

E.g
Code (Text):

<span data-playercounter-ip="my.server.ip">0</span>
 
Full Example:
Code (Text):

<!DOCTYPE html>
<html>
  <head>
    <!-- ... -->
    <script src="https://cdn.jsdelivr.net/gh/leonardosnt/ [email protected]/dist/mc-player-counter.min.js"></script>
  </head>
  <body>
    There are <span data-playercounter-ip="my.server.ip">0</span> players online on my server.
  </body>
</html>
 
Alternative CDN: https://cdn.rawgit.com/leonardosnt/mc-player-counter/1.1.0/dist/mc-player-counter.min.js (Is is not that reliable)

JsFiddle example: https://jsfiddle.net/ctu4kbzq/
Live example: https://cdn.rawgit.com/leonardosnt/mc-player-counter/master/examples/index.html
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

mc-player-counter | Displays the number of online players with 2 lines of HTML is a free Minecraft Java mod. Downloaded 2,009 times (via Spigot). Download it and open it directly in the game.

Explore more