Skip to content

Spigot plugin to display the scoreboard, PlaceholderAPI and other plugin statistics on the web

License

Notifications You must be signed in to change notification settings

Dantevg/WebStats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebStats

Exposes scoreboard and player online/AFK status to a webpage.

Requirements

  • A Spigot Minecraft server
  • A web server (note: the plugin will not work over https, so make sure the webpage isn't served over https either)

Usage

On Minecraft server: download the latest release and place in the plugins/ directory.

On web server: Include the source files:

<script src="Data.js"></script>
<script src="Display.js"></script>
<script src="Connection.js"></script>
<script src="Stats.js"></script>

Initialise WebStats after page load:

// You can set the update interval (in ms) *before* initialising WebStats (optional, default 10000)
WebStats.updateInterval = 0 // Set to 0 to disable auto-updating online player list

window.onload = () => {
	new WebStats({
		table: document.querySelector("table"), // The <table> element to use (required)
		ip: "203.0.113.42",                     // The IP of the server (required)
		port: 8080,                             // The port set in the config.yml on the server (required)
		sortBy: "Active Play Minutes",          // The initial sorted objective (optional, default "Player")
		descending: true,                       // The initial sorting direction (optional, default false)
	})
}

Plugin config file

  • port: the port number to use. Make sure you open a port on the Minecraft server and place it here
  • objectives: the list of objectives to send from server to webpage. * means all objectives