Minecraft command block commands (1.15)?

lu
- in Servers
11

I want to create a Minecraft server version 1.15.x (later 1.16.x). This server is for entertainment in Vanilla MC for some friends and me.

Unfortunately, I'm not very familiar with command block commands and would like to create a few things that go 100% in Vanilla MC (I have already installed this but deleted the commands).

The server should get a few ranks. These ranks should be based on the playing time (online time). Example, after 1h online time the player should get "rank 1". After another 4 hours, the user should receive "Rank 2".

My questions:

How can I install a time clock that updates itself for each player?

How can I rank higher for a certain number of past hours?

How can I create ranks?

Sy

Rank with command Block never Ever!

make a spigot server with plugins

lu

But. The ranks are said to have no function. These only serve as a legend. So it's actually with / team or something.

Sy

But how should the prefix go with a command block? That doesn't make it complicated, take spigot servers

lu

It's really not difficult in Vanilla MC but I pushed it out how it worked.

Sy

Yes that's why make spigot

lu

Got it out now. The commands are pretty simple:
Create team: / team add "Name" "Display name"
Add teammate: / team "name" join "player name"
Change team color: / team modify "Name" prefix {JSON String}
This would clarify how to create "ranks", now all that is missing is how I can link these in terms of time.

Sy

Unfortunately, can only help you with spigot because it is much better

Va

Do spigot / bukkit and you're done, this is not possible in vanilla and it is easier to make a plugin or if you can't program ask who or download one for it and set it up, it is easy and very easy

lu

I know it is in Vanilla. I'm just ready to track the online time of players and create the ranks. The only thing missing is that I hang in time and then remove and add ranks.

Btw. I'm an application developer, but I have nothing to do with Minecraft programming.

Be

First we need a scoreboard that counts the time.

/ scoreboard objectives add playtime minecraft.custom: minecraft.play_one_minute

Then you need a command block for each time you want to increase your rank. The command is as follows:

/ execute as @a [scores = {playtime = 72000}] run team join rang1 @s
/ execute as @a [scores = {playtime = 288000}] run team join rang2 @s

To get the number after the playtime =, you simply calculate the hours times 72,000, e.g. 4h x 72,000 = 288,000

You create the teams like this:

/ team add rank1
/ team add rank2

Then you can change the teams as you like. Here, for example, I made the player name dark red and behind the name Level 1. But you can do it the way you want.

/ team modify rang1 color dark_red
/ team modify rang1 suffix {"text": "| Level 1", "color": "red"}

lu

Thanks for the summary. I have already done it but it is always good to have the answers where ready.