Reference

Read Attribute

Outputs the live value of a server attribute, or of a custom attribute set earlier in the run.

Category
Data
Topics
Scheduler · Performance · Players · Server properties
01

Ports

Read Attributedata
  • None
  • Valueauto
Ports Control Data
Data types string number bool

Strings accept any data input.
Numbers accept boolean input.

02

Fields

Field What it does Default Limits
Attribute The attribute to read; a name that is not built in reads a custom attribute. tps
  • tps
  • players.count
  • ram.used (MB)
  • ram.left (MB)
  • server.status
  • players.max
  • ram.total (MB)
  • server.whitelist
  • server.port
  • server.gamemode
  • server.motd
  • server.world
Data type The type the value must have, which also sets the type of the Value port. Auto
  • Auto
  • String
  • Number
  • Boolean
03

What a run does

This block has no control ports.
It runs when a block that uses its Value runs, and reads the attribute once per run.
Every block using the same Read Attribute in that run gets the same value.

Attribute Value
tps The server's current ticks per second.
players.count The number of players online.
players.max The server's player limit.
ram.used (MB) The memory the server process uses, in MB.
ram.total (MB) The -Xmx memory limit of the server, in MB.
ram.left (MB) ram.total minus ram.used, in MB.
server.status 1 when the server is running, 0 when it is stopped.
server.whitelist The white-list value in server.properties, as text.
server.port The server-port value in server.properties, as text.
server.gamemode The gamemode value in server.properties, as text.
server.motd The motd value in server.properties, as text.
server.world The level-name value in server.properties, as text.

A name that is not built in is looked up among the custom attributes set earlier in the run.
Write Attribute sets them.

Data type checks the value before it is output.
Auto accepts any value, and the Value port then connects to any input.
Number needs a number, Boolean needs a boolean or 1 or 0, and String needs text.
A value of the wrong type, or an attribute that cannot be read, sets no output.
No error is shown, and the block that would use the value uses its own field instead.