Updated specific locations to be searchable, take a look at Las Vegas as an example.

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
A brief adventure in Realm protection.
Post Flair (click to view more posts with a particular flair)
Post Body

Howdy,like the title says, this is my account of the hacky work I've had to do to accomplish the simple task of keeping an open server, and somehow keeping it from being nuked.

In this migraine-driven essay I'll be talking about several different things you can't /technically/ do on Minecraft Bedrock for the Switch, yet. But I managed. So here we go....

First,

How I keep track of player inventory

The only items I really care about keeping out of circulation are command blocks. Because I can't use mods or special tools to accomplish this, this is the command I've used./execute if entity @a[hasitem={item=command_block}] run clear @s command_block -1 0

If this were a larger server this probably wouldn't work but for 10 players it's enough.With this command as written I can keep track of who does and doesn't have a command block at any time. This will be helpful later.

Next,

Checking if a player is on a scoreboard and if not, adding them

Because you can't currently do this directly with a single command and minecraft Bedrock doesn't currently have the Teams command,, and since it makes no sense to spam add players to a scoreboard, we have to do this in multiple steps. (also please disable both command output and admin command logging. Your eyes will thank you.

  1. Create a new objective./scoreboard objectives add Prs dummy Players
  2. Now we create a another for comparisons./scoreboard objectives add cmp dummy cmp
  3. Next we start by adding ourselves and 2 ghosts to the objectives. (you'll see why shortly)/scoreboard players add @s Prs 0/scoreboard players add #cmp Prs 0/scoreboard players add int cmp 0
  4. We add the new Player board to the sidebar./scoreboard objectives setdisplay sidebar Prs
  5. Next we have to check for player presence on our player list. To do this, we use the tag function, together with execute. This is where one of the ghosts comes in./execute score @a Prs >= int cmp run tag @s add trkr
  6. Now, anyone with a score is tagged, and those without are not. So we shall target the untagged, and add them to the board./execute if @a[tag=! trkr] run scoreboard players add @s Prs 0
  7. at this point, everyone should have a spot on our little player board and be tagged accordingly upon spawning into our world.(while everyone should be visible on your sidebar from the moment they spawn in, except for your ghosts, who you will not see outside of viewing the list via the command/scoreboard players list)

Now for the meat and potatoes.

How to use the scoreboard to determine who has an illegal item

Now since I have to use command blocks to institute certain game rules which do not have options available built-in, I can't simply turn them off. But, that doesn't mean I want them free floating elsewhere in the world. And because server nuking is a thing, it's incredibly helpful finding out WHO has command blocks.

Since we can't access server logs, we need to get creative.

We start with finding anyone that has a command block and assigning them a score./execute if score @a[hasitem={item=command_block}] Prs = int cmp run scoreboard players @s set Prs 1

This will find any player who has a command block, and has a default score of 0 to 1 for easy identification.Please keep in mind that this only works to find command blocks (and through a quirk of programming, chain command blocks.). You will need to run a separate command for repeating command blocks.

Now, if you're like me and use these blocks fairly often, you may want to exclude yourself from any measures. You can do this by assigning yourself a tag such like/tag @s add Admin

You would then modify your player tagging code by including the tag in your arguments. for example:/execute if @a[tag=! trkr , tag=! Admin] run scoreboard players add @s Prs 0

And when you assign your 'cheater' score, you would include your tag in the arguments there as well. For example:/execute if score @a[hasitem={item=command_block} , tag=! Admin] Prs = int cmp run scoreboard players @s set Prs 1This particular case will target anyone who BOTH has the offending item, AND does not have the admin tag. So if you wanted to make someone a mod, you would only need to apply the Admin tag to them, and they're score will not reflect them having the item in question.

If you can target multiple illegal items within one command, I'll find out for sure. In the meantime I hope someone finds this helpful. Maybe it inspires your own hacky workarounds for Bedrock's shortcomings. I welcome feedback and questions. It's nearly 1:30 AM. and I'm frickin' beat.

Author
Account Strength
100%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
656
Link Karma
112
Comment Karma
544
Profile updated: 1 day ago
Posts updated: 3 weeks ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago