Modern House Generator With Only Two Command Block
LINK ->>> https://urlca.com/2tFxla
In this example, we are going to build a house that is complete with a dark oak door, glass pane windows, a bed, a crafting table, a large chest, and torches on both the inside and outside of the house. We use various fill commands and setblock commands to build the house.
Command blocks and functions can be used, among many other things, to change the difficulty, change the state of the weather, or give a player predesignated items. They are particularly useful for the /weather and /time set commands, as they are only available in cheat mode otherwise. The /time set command is especially useful, as it allows players to change the current time to a preset time at the press of a button.
Redstone can wirelessly be 'transmitted' by placing a redstone block at a certain location. The downside to this method is that the chunks being transmitted to must be loaded. This method is often used with Adventure maps to trigger more command blocks.
To not require loading chunks, the scoreboard is needed. The second command will only complete successfully if the first has been run. Either a comparator or chained conditional command blocks can detect the success. The second command block should be set to repeat.
The previous is often used in conjunction with buttons. Sometimes however, there might not be enough room to hide a command block. In that case, the player can use a repeating command block to test if a button on (x, y, z) is pressed.
The problem with this setup is that players can only get the starter kit once, even if they die. To fix this, use these commands. The first command should only be run once, probably by the player rather than a command block.
The player can teleport by using the /teleport teleport or tp commands, where y is the vertical difference between the upper and lower elevator entrances.The elevator can also be made to tp a player to any coordinate just by leaving out the ~ before the numbers. When ~ is left in the command, the normal (x,y,z) is set to (0,0,0) where the command was made, such as standing on a pressure plate or wherever the player is standing when the command block received power. If a pressure plate was at the coordinates of (-36,96,-12) that ran to a command block with a command of /teleport @p ~3 ~4 ~5 it would tp the player to the coordinates of (-33,100,-7). The same outcome can be achieved by having the command of /teleport @p -33 100 -7 one block must be subtracted from the x and z axis to get to the right coordinates. Using @p, @s, @a @e.
Command blocks can also be used to make a security system. Just put a pressure plate which triggers a command block in front of an iron door, which will be the entrance to the house. Insert the command: kill @e[type=(mob)] and hook it up with chain command blocks to kill different mobs. this is to not kill you or other players. do this second command in a command block to teleport all things in the vicinity: tp @e[r=2] ~(any distance) ~(any distance) ~(any distance)
Pressure plates only blend in with only gold, iron, stone, and wood planks, but cannot be concealed in any other floor; command blocks can be used instead. Pressure plates can be replaced with a command block by using the if argument in the command /execute with a range and a clock circuit. The command /execute if @p[distance=..2] will test to see if any players are within a range of 2 (the command block itself plus 2 more blocks in every direction). Range 2 is the range a player want for a command block under a floor. Keep in mind that it will produce a globe shaped trigger area (rather than a cube), so a range of 2 makes an approximately 5×5×5 area and a range of 1 makes a 3×3×3 area (more like a + pattern with an extra block above and below the center). The player can get around this by using the dx, dy and dz arguments.
Players can now create passwords with command blocks, using the if block argument on /execute. Place a command block. This will be the one you put input in. Place another command block, and type in the following command:/execute if block command_block{Command:""}Example:/execute if block ~2 ~ ~ command_block{Command:"That's Numberwang!"}Place a comparator connected to the second command block, and place a button on or next to it to power the block. Now type "That's Numberwang!" (without quotes). If the second command block properly finds the first, the comparator will activate whatever it's wired to. If you want the first command block to reset so the password isn't used by someone else, also place a command block with /setblock that activates after /execute.
If you don't want to let people edit your command block, you can test for a sign instead, but this means having to test for the password separately on each of the sign's 4 lines. To add a touch, you can fill the sign with air, but remember to give it back using /give @p sign.
The player can do /kill @e[distance=..2] in a command block below a block with a pressure plate to make a multi-use landmine that kills all nearby entities upon stepping on it (including players, item frames, and paintings)
Note that booby traps that use @p can be dangerous due to the fact that non-player entities could trigger them (if something like a pressure plate is used), resulting in the teleportation of the nearest player, no matter how far away they are and regardless of the fact that they haven't actually stepped on the plate. To get around this, players can either use the /execute if entity command as an invisible pressure plate, or they can do /teleport @p[distance=..] x y z rot rot. Hook a clock circuit up to a command block programmed with /execute if entity @p[x=1, y=2, z=3, distance=..], with the coordinates changed as appropriate. Note that as of Java Edition 1.8 a range of zero can now be specified.
It is possible to make teleporters using the command block. (e.g. /teleport @p ) Taking it one step further, a teleporting station can be made, with multiple button-activated teleporters that each teleport to different locations. Scouting and testing teleportation destinations first is advisable, to make sure players don't end up stuck inside blocks or in other unintended places. If players appear in ground while testing coordinates, use /teleport @p ~ ~8 ~ to get out (may require multiple uses).
If a player use the teleport command with the command block, one can use relative coordinates in the destination coordinates by placing an ~ in front of a coordinate (e.g. code: /teleport @p ~ ~8 ~. This would teleport the player 8 blocks into the air).
Commands that use coordinates (e.g. /teleport or /spawnpoint) add 0.5 to whole numbers when no decimal follows. This is so you appear centered over the block you appear on instead of at the edge or corner of it. For example, the number -33 would execute as -32.5, and 187 as 187.5. To prevent this behavior, add .0 (25.3, 90.0) after them, as these values are executed left as-is. It is also possible to teleport minecarts or boats, with players in them. The command is /teleport @e[type=boat] .
By swapping gamemode it is possible to use command blocks and functions in single player outside of creative mode. Simply swap to creative mode with the /gamemode creative command, set the command block command to whatever the player want, then swap back to /gamemode survival. The command block only needs to be set in creative, but will still function once back in normal.
As mentioned above one can create a lottery but that lottery is usable by the public. A simple edit can change that... First create a new objective. (For example: /scoreboard objectives add lottery dummy) Then use this command on a command block /scoreboard players add lottery 1 to enter players into the lottery then do /give @r[scores={lottery=1..}] to start the lottery and only the players chosen can be in the lottery.
By rigging a fast clock to a command block executing /teleport , they can force a player to stay at a certain place. If they do this it would be advisable to either turn off commands in their chat settings or do /gamerule commandBlockOutput false. Using the "Range" and "Minimum Range" parameters, they can have it teleport players back only when they're a certain distance away.
If player place a repeating command block with "Always Active" option, they can set /teleport @a[gamemode=creative] ~0 ~1 ~0 for hilarious (like really hilarious) results. This could be a way to get creative mode people to change to Survival and is also really fun to watch.
One could also utilize the distance argument defining an area-of-effect /gamemode adventure @a[gamemode=!creative,distance=0..(X)] combined with a deactivating command block /gamemode survival @a[gamemode=!creative,distance=(X+2)..(X+12)]. Set both blocks to repeat and be self-powered and there should be a fairly "seamless" transition zone between normal and protected. The distance variables for the range of effect (specifically the reversion block) can vary, but a buffer between the X and X+2 variables should be there to accommodate the second block being at a different position than the protection block. The gap between the two variables in the reversion block need not be exactly 10 blocks, but a buffer helps for lag concerns in guaranteeing that once left, a player will revert back to survival mode.
When a player walks over a pressure plate, it can trigger a command block with /say or /title title . @p can be used within the message to display the player closest to the command block upon triggering.
If a certain player has been very nice, regular, or helpful to the server but not quite meeting the requirements to be promoted to an admin, players could have a room full of buttons connected to command blocks with helpful effects, like giving the helpful player a stack of diamonds or a bedrock block, then have it connected to another command block, sending them to the spawn point. (It is very important this room is reinforced with bedrock, hidden, and you can only get in by teleporting to its co-ordinates to avoid abuse). 781b155fdc