Hello! In this tutorial I’ll show you many things relating to scoreboards and how to use them for math, mapmaking, whatever your purposes are. At the beginning I’ll show you a simple example of how to count entities. Then I’ll get into explaining the scoreboard operation command which Is used to do basic mathematical operations. Stuff like addition and subtraction and also, this thing? I legitimately didn’t know what this did but it’s actually super useful, so stay till the end of the video and I’ll tell you what that one does! Without further ado, let’s get into it. Hold on to your… *laugh* chain command blocks, things are going to get weird. Let’s say we want to count all the entities in the world and get it saved to a number in a scoreboard So that we could, I don’t know, do something when there’s a certain amount of entities in the world, or if it drops below an amount spawn in more. Use your imagination, I’m just going to show you the technical part of it. First we’re going to create a special kind of objectives, so slash scoreboard objectives add, call this one count, and we’re gonna create the type “dummy.” Setting the criteria as dummy means that it won’t be affected by any in-game stats. None of this. It will only be affected by things we do to it. So if we add to it it will go up, if we subtract from it it will go down, but it will not change for any other reason. So this is where scoreboards get kind of strange, because they’re stored in a player. It’s always a score associated with a specific username. That’s kind of weird. For testing purposes, we’re going to set our new count objective to appear in the sidebar, You can pause and look at the command if you’ve forgotten it. “count” will now appear in the sidebar. Now, if I add myself a little bit of count- “scoreboard players add Legitermoose count 1” I will slowly count up. Very, very nice. The trouble with assigning actual players Scores is that it’s, it’s just associated with the player. A nice thing about this is that, setting scoreboard “players,” really more of a scoreboard holder- something not everybody knows is that “player names” can actually take special characters that actual usernames cannot contain. So we can put- we can put parentheses in here, we can put carrots, percent signs, pretty much anything you can find on your keyboard, can go into a username and appear on there. Now that I’ve made a mess of my sidebar I’m going to show you how to clear it. For this we’re going to need to do “scoreboard players reset”, and then if we want to reset everybody, we can actually use An asterisk(*), and that is what’s called a wild card, and it will select everybody who has any score on this scoreboard so in that case Legitermoose and comma period slash comma period period slash comma period slash Legitermoose as well. If I reset count, it’s gone. Amazing. If You’re enjoying this video so far, make sure to subscribe. It makes me happy that there are still people out there who want to learn Minecraft commands, as it’s one of my favorite hobbies. Anyway, I’ll let you get back to the video. So how do we count all entities? Let’s get back to that. For that we’re going to need to set some player to be our scorekeeper so I’m going to say scoreboard players set hashtag count count and I’ll set their score to zero. Do they appear on the sidebar? No They don’t. It is the presence of the hashtag that prevents them from appearing on the side. So if we put a hashtag it will not appear. This can be useful if you want to track like invisible scores And yet still have other people’s scores visible. Actually I’m not gonna use a hashtag and hide it, because I would like to see it for debugging purposes, so we’re gonna use !Count. Get yourself a command block. If you’re ever doing this for a proper reason I would recommend doing it in a data Pack. My data pack tutorial, link up in the, in the top right corner there, goes into how to do this the proper way. Okay. I’m just gonna make a chain of command blocks so in our first one We’re gonna do scoreboard players set !Count and set their count score to zero. So whenever we flip this,!Count score is going to get reset. In the next one we just have each entity run a Command that adds one to the score. So execute as @e so this will get run by every entity that is currently loaded in the world. Run scoreboard players add !Count count score one. One two three four five six seven well yes, we should now have thirteen. We do! Amazing. Just remember to reset It, if you didn’t have this command here then it would go up every time, and that is not ideal. So that’s how you do basic math that’s how you add with scoreboards, but if you’re a true programmy Minecraft technical boy, you will want to know how to do ever so slightly more advanced math like… subtraction! Now it’s time for awesome mathematics create a new scoreboard objective called numbers and make it a dummy, because this is the only way to do numbers with random arbitrary Numbers. You’ll see why in a second. Scoreboard players operation is what we want. This will run an operation, a mathematical operation, on the scores that we have, on whatever score we choose, by whatever other score we choose. So we have this long scary list. Some of these are simpler Than others. The equals sign for example just sets it to something else. So this will set my account score to the count score of some other player. Let’s add another player. Scoreboard players set Legitimoose, my original account that I’m locked out of at the moment, we’ll set That to 10. I meant to set numbers, probably should have picked a shorter name than numbers, like num or something, Legitimoose numbers and we want to set it equal to my Legitermoose numbers, and that just works. It sets it to the second score. Let’s try another one, let’s add them Together. You may notice these equal sign, that’s a, that’s a programming thing, that means it will both add the number and then set it to the number so, plus equals will add and increase the number, which is kind of how it’s assumed to work in most situations. Scoreboard operations @s that’s, That’s just for the player running the command @s is like what @p people used to use @p for that nowadays you use @s. Operations @s numbers, @s numbers this will add one plus one Legitermoose plus Legitimoose equals? Oo. Okay let’s try some of the other ones minus equals that will subtract Our score by itself and now we’re at zero. This is all awfully abstract in this form, when you get into making minigames or something, I promise you this will come up, you will be the only person Who knows how to do this stuff. So the other ones, I’ll just tell you what the other ones do rather than showing you. Asterisk equals that’s, that’s supposed to be a times symbol it’s a tiny little x so this is multiplication, addition, subtraction, slash equals is division. But keep in mind it Can only divide integers so it won’t give you a fraction. Then there’s less than so it will set it to the lesser of the two numbers. How about if it’s greater than, it will set it to the greater Of the two numbers. What about this one? What does that one do actually? Hold on. Okay, that’s confusing, that’s not greater than and less than, that’s swap, so I can swap my score with the score of my alter ego Legitimoose. And see Legitimoose, Legitermoose have switched places. And there’s one That I saved for last, which is this percent equals this is a computer science function, this is something that’s used quite a lot in programming. It’s called modulo and what it does is it gives you the remainder of something. But where do we go from here? You’ve learned pretty Much all there is to the slash scoreboard command. Well, there are a couple things. First off I used the slash execute command in my entity count example, so if you want to learn that I’ve already Got a tutorial made. Please subscribe and let me know in the comments what you would like to learn! …That’s all recording is hard. Video Information
This video, titled ‘Minecraft Scoreboard Operation Tutorial [1.16-1.20] How to Count Entities’, was uploaded by Legitimoose on 2020-09-18 22:36:56. It has garnered 97603 views and 3940 likes. The duration of the video is 00:08:16 or 496 seconds.
In this Minecraft scoreboard tutorial, learn how to use “/scoreboard players operation” in Minecraft 1.16/1.17 (working in 1.19 and 1.18)! This command is good for minigames, PvP, datapacks, and anywhere you need to do math operations with scoreboards! I’ll show you how to count entities with commands
===l o n k s=== My Discord Server [ https://discord.gg/n7z4sVG ] My Twitch [ https://www.twitch.tv/legitimoose ] My Editor [ https://www.instagram.com/ciara_millinery/ ]
This is the latest scoreboard operation tutorial. I saw a lack of minecraft 1.17 scoreboard tutorial(s). Learn how to use the scoreboard command in minecraft, how to use /scoreboard, or how to do math with scoreboards in minecraft. This could help you learn how to make a calculator in minecraft, or how to make a death counter/kill counter/entity counter in minecraft 1.16.5! This isn’t a redstone tutorial, it’s a minecraft command tutorial/minecraft command how to. This is good for minecraft datapacks/data packs (the official spelling), and map making/mapmaking in vanilla minecraft. If you want to make minecraft minigames in vanilla like on big servers (cough hypixel cough), then watch this minecraft scoreboard tutorial, and learn the advanced features of the /scoreboard command in 1.16.