Server Pinging

Yes, it is possible to display the MOTD or player count of a server via Item!

Step #1 Tell BossShop to look for Data of a named Server

Simply add this line to your ShopItem:

ServerPinging: <host>:<port>

now BossShop will try to get the MOTD and Player count of the server with the host address <host> and the port <port>.

Example:

shop:
  SnapcraftHub:
    RewardType: playercommand
    PriceType: free
    Reward: server hub
    MenuItem:
    - type:GOLDEN_APPLE
    - amount:1
    - name:&c&l&nS&6&l&nn&e&l&na&a&l&np&b&l&nc&d&l&nr&b&l&na&a&l&nf&e&l&nt&r &6&lHub
    - lore:&7Click to connect!#&e%players% &3online
    - durability:1
    InventoryLocation: 1
    ExtraPermission: ''
    ServerPinging: mc.snapcraft.net:25565

Step #2 Use the Data in the Lore or Displayname of an Item

Where can I use the MOTD/Player count of a server?

  • In Lore/Name of MenuItems
  • Only works for MenuItems which belong to a ShopItem which is connected to a server

You can use following tags:

  • %players% | Will display the Player count of the named server
  • %motd% | Will display the Motd of the named server

Example:

    MenuItem:
    - type:REDSTONE
    - amount:1
    - name:&4Cool Server
    - lore:&c%players% online

Additional Information

  • The MOTD and player count values are updated real-time, even when players have their mouse hovered on the items
  • You can define the pinging delay in the Config.yml. The delay is defined in ticks (20 Ticks = 1 second).

Comments

Posts Quoted:
Reply
Clear All Quotes