Class 3 notes: Java Coding Class

Updated: Aug 7, 2021

Hi everyone! This post covers everything we learned in the last class for people who have missed it and also for you guys to study!


Things we learned: /effect command

/fill command

/summon command


The first command that we touched on was the effect command. This command allows you to give any potion effect to any player at any time!

Just like normal, we start the command with '/effect'. For the next parameter, there are two options: give, and clear. If you pick clear that means you just want to clear your effects, and after that, you can just type in the player you want to clear. The give option is what you will use most, and that is what allows you to give the effect. The next parameter, after you have put in the player you want to give the effect to, is the effects that you can choose from. Just type in the command you need, you don't have to worry about the minecraft: part. Just make sure you spell it right! So far we have the command written down:


/effect give (player) (effect)

You can run this just fine right now, but if you want to get into how to make multipliers as well as how long it lasts, continue reading.

The next parameter that you can put in is the number of seconds. After you put the effect, just type a number, in my case I want to give myself strength for 10 seconds.

This command would look like this:

/effect give (player) strength 10

Don't get this mixed up with the multiplier. The number 10 in the code means seconds, not that I want to give myself strength with a multiplier of 10. The next parameter is, though. After you enter the number of seconds you would like to put in, the next number is the multiplier.

Say I want to give myself strength with a multiplier of 5 for 10 seconds. The command would look like this:

/effect give (player) strength 10 5

This gives you strength for 10 seconds with a multiplier of 5. That's pretty much it for the effect command, but there is another sneaky parameter that is very useful sometimes.

This last parameter allows you to hide the particles that emit when you have an effect. If you want to hide the particles, simply write 'true' at the end of the command, and if you don't you can just write false.


Tip #1: Anytime you are using commands in Minecraft that let you input an amount in seconds if you want to make the amount infinite just put 999999! That's the limit of seconds you can input, and it's so high that Minecraft thinks that it's just infinity.


Tip #2: The limit for effect multipliers is 255. You should try giving yourself speed 255 for 999,999 seconds! For some effects though, their multipliers don't do anything. For example, blindness and nausea with a multiplier of 255 don't do anything more than a value of 1!

The next command that we touched on is the fill command. This command is easy to understand as long as you know the setblock command. This allows you to fill a large area with blocks. This, as well as the setblock command, uses coordinates. To set this up, you want to place two blocks to make a cube of the area you want. This will always make a cube and cannot make a sphere, so keep that in mind when you are using this command, and always be aware of your surroundings as there is no undo button. Once you have your two blocks ready to form a giant rectangle thing, you need to get the locations of the two blocks.

What you need to do to get the location is look at the block, open your debug menu, and then look at the 'targeted block' line on the right. Underneath it, you will find the location of the block you are looking at. Copy this exact number, and do the same for the other and write it down next to it. It should look something like this:

/fill 32 64 12 (block 1) 45 92 12 (block 2)         

Without the parentheses, your command should look like this:

/fill 32 64 12 45 92 12

Now that you have found the location of the two blocks, you can then type the block you would like to fill the space with. After that, you can enter the command just fine!

Mine looked like this:


/fill 32 64 12 45 92 12 diamond_block

Yours should too!


Tip #1: After you put diamond_block, there is another secret parameter that you can type. If you type 'hollow' after the block, it will make the rectangle hollow inside! You will see there are also 4 more parameters, but those are a little confusing so I won't get into them here.

Tip #2: DO NOT fill very large areas of blocks! This will lag the server and also there is a limit, so be courteous of others and refrain from building the biggest Minecraft house ever imaginable! And always, even if your fill command is small, be aware of your surroundings!

Tip #3: This might sound like something similar that you have seen some YouTubers use before. Some people who do not want to learn the fill command install a plugin for their Minecraft server called 'WorldEdit'. This is basically an easier fill command with no commands needed. You just take an axe and right-click on the two points, then right-click on the block you want to replace them with. I think it is very important to learn the fill command because you probably don't want to install WorldEdit for every single Minecraft build you make. I certainly know I don't!


The final command that we touched on in the previous class is the summon command. This allows you to summon any entity in the game. This is the easiest of them all to learn.

As usual, we start the command with /summon. Then, we input the entity we want to summon, and if needed, the location in X Y Z format afterward. That's all the parameters for the summon command.


TIP: If you don't know what X Y Z coordinates are, I made an article explaining it here!

Java Coding Class: X Y Z coordinates (wequil.school) That's pretty much everything we covered in the 3rd class, and I hope you learned something! See you next class!


- Benny