Minecraft How to Make It So You Can Place an Item Only on a Certain Block 1.13
This commodity needs cleanup to comply with the manner guide.[discuss ]
Please help improve this page. The talk page may contain suggestions.
Reason: remove uses of individual commands
Contents
- ane General applications
- 2 Basic usage of commands
- ii.1 Cookie journalist
- 2.2 Time warper
- 2.3 Wireless redstone
- 2.4 Wireless buttons
- 2.5 Starter kits
- 2.6 Teleporting
- 2.vii Security System for Mobs or Players
- ii.8 Moving Sidewalk
- 2.9 Replacement for pressure plates
- 2.10 Commanding Passwords
- 2.11 The Destroyer
- ii.12 Landscaper
- 2.13 Booby traps
- 2.xiv Teleporters
- 2.15 Control-Piston-Repeater Fun
- 2.15.i Fast Pusher
- 2.15.two Deadening Pusher
- 2.16 Working Minecart with Dispenser
- 3 Singleplayer non-Creative maps
- 4 Multiplayer applications
- iv.one Command-based flying
- 4.1.1 /tp command
- iv.1.2 /clone control
- iv.ane.3 /summon command
- iv.2 /data (merge/modify) [entity] command
- 4.3 Teleportation/Transport
- iv.4 Stop-Motion Animation
- 4.5 Lottery
- iv.6 Jails
- 4.seven Creative Only
- 4.viii Fun anti-creative fashion trap
- iv.ix Announcements
- 4.10 Security Scan
- 4.11 Race Referee
- four.12 Creative Area/World Guard
- iv.xiii Improving PvP without Plugins
- 4.14 Starter Kits
- iv.15 Colorful Messages
- 4.16 Alarm System
- iv.17 Remove Players
- four.18 Reward Room
- 4.xix Weather Machine
- four.twenty Obstacle Course Prizes
- 4.21 Fourth dimension Machine
- 4.22 Proximity Mine
- 4.23 Secure Doors
- four.24 Custom Commands
- iv.one Command-based flying
- five Application in custom maps
- 5.one Silent Control Block
- five.2 Safe Haven/Arena Fight Zone
- five.3 Detecting Cheaters
- 5.4 It'south bigger on the inside
- 5.5 Save game
- five.6 Lava parkours
- 5.vii Even so desire a bed?
- v.viii Time and weather following the scenario
- 5.9 Detecting Players who switched to Peaceful
- 5.10 Talking Adventure Map
- 5.11 Making a Store
- six Spawners
- 6.1 Part one: The Basics
- vi.2 Part 2: Custom monsters
- vi.3 Function 3: SpawnPotentials
- 6.4 Part 4: Rideable Monsters
- 7 More commands in fewer command blocks and recursion
- 8 Using a map particular as a scroll
- nine Further reading
- 10 Video
- 11 See also
General applications [ ]
Command blocks and functions can be used, among many other things, to change the difficulty, modify the land of the conditions, or give a player predesignated items. They are particularly useful for the /weather and /time set commands, as they are merely available in cheat mode otherwise. The /time gear up command is especially useful, as it allows players to change the current time to a preset time at the printing of a button.
Command blocks and functions can also be used to make text appear in the person's chat card. The code to do this is /tell @p <message>, or /tell <username> <message>. If the @p parameter is present only the nearest person volition see the bulletin. If a username was specified, the username will be sent the message. The player can also type: /tell <your username> @p, east.g. /tell <username> and whenever someone walks over information technology, it will say: "[@] whispers to the player: <username>".
Changing the difficulty is achieved past /difficulty <name of the difficulty> (e.g. /difficulty peaceful).
Another mode to use control blocks and functions is to use /teleport @p <coordinates> to teleport between dissimilar bases in a world.
Bones usage of commands [ ]
There are many things players tin can do with control blocks. Here are examples of some of them:
Cookie announcer [ ]
When run in order, such every bit in a chain of control blocks or functions, these commands will give a random actor five cookies.
/tag @r add cookie
/give @a[tag=cookie] minecraft:cookie 5
/say @a[tag=cookie] has been given 5 cookies!
/tag @a[tag=cookie] remove cookie
Time warper [ ]
By putting this command inside a repeating command cake, the role player tin make fourth dimension speed up. Arrange the number to change how fast it goes.
/time add together 5
Wireless redstone [ ]
Redstone can wirelessly be 'transmitted' past 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 Gamble maps to trigger more command blocks.
/setblock <x> <y> <z> redstone_block
/setblock <10> <y> <z> stone
To non 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 tin detect the success. The second command cake should be set to repeat.
/scoreboard objectives add signal dummy
/scoreboard objectives remove signal
Wireless buttons [ ]
The previous is oftentimes used in conjunction with buttons. Sometimes still, there might not be plenty room to hide a command block. In that case, the player tin can use a repeating command block to test if a button on (x, y, z) is pressed.
/execute if block <x1> <y1> <z1> #minecraft:buttons[powered=truthful] run clone <x1> <y1> <z1> <x2> <y2> <z2> <x3> <y3> <z3>
Starter kits [ ]
Using command blocks users tin can give starter kits to new players.
/clear @p[tag=!started,altitude=..five]
/tag @p add together started
/give @p iron_sword
/give @p breadstuff 5
/teleport @p <10> <y> <z>
The trouble 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 control should merely be run once, probably by the role player rather than a command block.
/scoreboard objectives add died deathCount
/tag remove @p[scores={died=0..}] started
/scoreboard players set @p died 0
Teleporting [ ]
The histrion can teleport by using the /teleport teleport or tp <y> commands, where y is the vertical difference between the upper and lower elevator entrances. The elevator tin also be made to tp a player to any coordinate simply by leaving out the ~ earlier 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 equally standing on a pressure plate or wherever the player is standing when the control 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 ~five it would tp the actor to the coordinates of (-33,100,-7). The aforementioned outcome can exist accomplished past having the control of /teleport @p -33 100 -seven one block must exist subtracted from the 10 and z axis to get to the right coordinates. Using @p, @s, @a @e.
Security System for Mobs or Players [ ]
Command blocks tin also be used to make a security system. Simply put a pressure level plate which triggers a control block in front end of an iron door, which volition exist the entrance to the house. Insert the control: kill @e[type=(mob)] and claw it up with chain command blocks to kill different mobs. this is to not impale you lot or other players. do this second control in a command block to teleport all things in the vicinity: tp @eastward[r=ii] ~(any distance) ~(whatsoever distance) ~(any distance)
Moving Sidewalk [ ]
A like concept to the elevator just made to move a player along the ten or z coordinates. This tin can be created by:
- Utilize the
/fillcontrol.
/fill <x1> <y1> <z1> <x2> <y2> <z2> command_block{Command:"/execute equally @p at @southward run teleport @s ~-1 ~ ~"}
- Edit the coordinates within the brackets to alter the direction the actor will move
- Place pressure plates on top of all the command blocks.
- Footstep on it
Users might want to plough command cake output off since the conversation will keep spamming command block output.
Replacement for pressure plates [ ]
Pressure plates only blend in with only gold, iron, stone, and wood planks, but cannot exist concealed in any other flooring; command blocks tin can be used instead. Pressure plates can exist replaced with a command cake by using the if statement in the command /execute with a range and a clock excursion. The command /execute if @p[distance=..2] will exam to see if whatever players are within a range of 2 (the command block itself plus 2 more blocks in every management). Range 2 is the range a role player want for a command cake under a floor. Keep in mind that information technology will produce a globe shaped trigger area (rather than a cube), so a range of 2 makes an approximately 5×five×5 surface area and a range of one makes a 3×3×iii surface area (more like a + pattern with an extra block above and below the eye). The actor can get effectually this by using the dx, dy and dz arguments.
Alternately the player tin can specify the x, y and z coordinates in the control (e.m. /execute if @p[x=50,y=64,z=46,distance=..1] but be warned that the range cannot exist shrinked to the 1-block point. Every bit with the non-xyz version range means center block plus range number of blocks around it, which makes sense from a command block (where "simply the center block" would mean you take to be standing in the command block) merely doesn't brand sense here. At whatsoever rate a range 1 sphere (+ pattern with an extra block on top and lesser) can be buried underground with merely the summit sticking out, provided the histrion know no i volition be walking through the lesser 2 layers of the world. Trying this with the non-xyz version of the control would require the command block itself to be embedded in the surface of the flooring where it can be seen.
Important notation: When writing the code in brackets [], do not put spaces between commas , : Do not add together / during coding unless instructed to.
Bad: [x=0, y=0, z=0, distance=..ane]
Bad: [10=0 ,y=0 ,z=0 ,distance=..1]
Bad: [x=0 , y=0 , z=0 , distance=..1]
Adept: [x=0,y=0,z=0,distance=..1]
Commanding Passwords [ ]
Players can at present create passwords with control blocks, using the if block argument on /execute. Place a command cake. This volition exist the one you put input in. Place some other control block, and type in the following control:
/execute if cake <x, y, z coordinates of first command block> command_block{Command:"<input>"} Example:
/execute if block ~2 ~ ~ command_block{Control:"That's Numberwang!"} Identify a comparator continued to the 2d command cake, and place a button on or side by side to it to power the block. Now type "That's Numberwang!" (without quotes). If the 2d command cake properly finds the first, the comparator volition actuate whatever it'southward wired to. If yous desire the start command block to reset so the password isn't used past someone else, also place a command block with /setblock that activates after /execute.
If you don't want to allow people edit your command cake, you can examination for a sign instead, but this ways having to test for the password separately on each of the sign's 4 lines. To add together a touch, you tin can fill the sign with air, but remember to give it dorsum using /give @p sign.
The Destroyer [ ]
This allows the histrion to destroy a cube of materials around them as they walk, using /execute. The control is /execute as @p at @s run fill ~1 ~2 ~1 ~-1 ~0 ~-one air[ Java Edition only ] or /execute @p ~ ~ ~ fill ~i ~ii ~one ~-1 ~0 ~-1 air[ Boulder Edition only ]. Use the repeating command block with the "Ever Active" option selected, and the cube of air will be created wherever a player go. Basically, /fill up takes out a specified amount of space, similar to /setblock, but it uses two coordinates and fills the space in between them with the fabric of the players choosing . In this example, that material would be air. Now, every time a player moves, it will fill a 3×3 cube of air around the player. A destroyer is great for enemy bases, or simply being a crazy griefer.
- This likewise deletes water, so the thespian basically becomes a moving sponge. To non remove water, use
/execute as @p at @s run fill ~1 ~2 ~1 ~-ane ~0 ~-1 air keep waterinstead. - This works in whatsoever game style.
Landscaper [ ]
This is a reversed version of Destroyer. /execute as @p at @s run make full ~1 ~-one ~ane ~-one ~-1 ~-1 grass_block[ Java Edition only ] or /execute @p ~ ~ ~ fill up ~1 ~-one ~i ~-1 ~-1 ~-1 grass[ Bedrock Edition only ]. This puts a 3×iii grass square under a player.
Booby traps [ ]
An extremely lethal booby trap would be a command block fix to teleport someone into the void.
The role player can do /kill @e[distance=..2] in a command block below a cake with a pressure plate to brand a multi-use landmine that kills all nearby entities upon stepping on information technology (including players, item frames, and paintings)
Note that booby traps that use @p tin 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 go around this, players can either utilize the /execute if entity control as an invisible pressure plate, or they tin can practice /teleport @p[distance=..<radius>] x y z rot<x> rot<y>. Hook a clock circuit upwardly to a command block programmed with /execute if entity @p[ten=1, y=2, z=three, distance=..<radius>], with the coordinates changed as advisable. Notation that every bit of Java Edition ane.8 a range of null can now be specified.
Teleporters [ ]
It is possible to make teleporters using the command block. (e.chiliad. /teleport @p <10> <y> <z>) Taking it one step farther, a teleporting station can exist fabricated, 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 stop up stuck inside blocks or in other unintended places. If players appear in ground while testing coordinates, use /teleport @p ~ ~viii ~ to get out (may require multiple uses).
If a role player use the teleport command with the command cake, one tin use relative coordinates in the destination coordinates by placing an ~ in front of a coordinate (e.k. lawmaking: /teleport @p ~ ~eight ~. This would teleport the player 8 blocks into the air).
Commands that use coordinates (e.g. /teleport or /spawnpoint) add 0.five to whole numbers when no decimal follows. This is then you appear centered over the block yous appear on instead of at the border or corner of it. For example, the number -33 would execute as -32.5, and 187 every bit 187.5. To forbid this behavior, add .0 (25.iii, xc.0) after them, equally these values are executed left as-is.
It is besides possible to teleport minecarts or boats, with players in them. The control is /teleport @e[blazon=boat] <x> <y> <z>.
Command-Piston-Repeater Fun [ ]
- Control block:
/setblock <x> <y> <z> minecraft:sand - 1st Piston Front: Showing to fix
/setblock <x> <y> <z> minecraft:sandto that position
Fast Pusher [ ]
Notation: Repeaters are risen past 1 block from i to three for visualization
- 1 (i Repeater): Prepare to 1
- 2 (i Repeater): Fix to three
- three (2 Repeaters): Set to 4 and 2
- four (1 Repeater): Ready to 2
- five (2 Repeaters): Prepare to 4 and 1
- vi (ii Repeaters): Set to four and 4
- 7 (one Repeater): Set to 2
- 8 and nine (2 Repeaters): Prepare to 4 and four
Slow Pusher [ ]
- i (Repeater): Set to 4
- 2 (Repeater): Set to 4
- 3 (Repeater): Prepare to 4
- 4 (Repeater): Set to one
- 5 (Repeater): Set to ane
- 6 (Repeater): Set to 1
- viii (Repeater): Ready to 4
- 9 (Repeater): Prepare to two
- ten (Repeater): Set to two
Working Minecart with Dispenser [ ]
To create a working minecart with dispenser, run this command: /summon minecraft:command_block_minecart ~ ~ ~ {CustomDisplayTile:1,DisplayTile:dispenser,DisplayOffset:ten}
"CustomDisplayTile" tells the game to return the block in the cart differently. "displayTile" tells it to change it to a certain block ID (a Dispenser). Come across This Minecraft Forum article for a meliorate explanation of this, and other useful things.
Add this control to the "dispenser" by correct clicking it: /summon arrow ~ ~ ~1.5 {Movement:[0.0,0.0,1.0]}
Singleplayer non-Creative maps [ ]
By swapping gamemode it is possible to utilize command blocks and functions in single histrion outside of creative style. Only swap to creative mode with the /gamemode artistic command, set up the control block command to any the actor desire, then bandy back to /gamemode survival. The command block only needs to be gear up in artistic, merely will still function once dorsum in normal.
It can also be used to teleport to certain areas (for example a far-away stronghold, a deep mining operation, or a floating island). If information technology took the histrion a very long time to get in that location, and if they don't mind sort-of adulterous, then you can set up a teleport system. Make certain that the actor are on Creative mode while setting information technology (apply the control /gamemode creative. If they don't have cheats enabled, open up the LAN and fix the cheats on), but they can still activate it in Survival manner. Type this command in when having the command block GUI open /teleport @p <x> <y> <z>. And so, activate the control block with redstone (including buttons, levers, and force per unit area plates), and they will be sent to their destination. The player tin can fix up multiple different teleports. This can likewise exist used when doing a big projection that spans over a very big surface area or if they are transferring chests to from an old house to a newer house.
Multiplayer applications [ ]
This department details the applications of the command cake in multiplayer.
Control-based flight [ ]
Commands tin can also exist used for flying entities or structures. Most commands based flying machines utilize command blocks so that when the player turns on an input, information technology activates certain command blocks. Unlike piston based technologies, however, these cannot be legitimately made in survival as command blocks require fix by an operator in creative mode.
/tp control [ ]
Using the /tp command, entities can be teleported in a specific management in small repeated increments, to exhibit a shine flying. With clever command usage, movement tin can be controlled by various means such as holding a specific item
/clone command [ ]
Using the /clone command, it is possible to more easily motion structures past cloning them and teleporting entities in it with /tp. Information technology tin exist accomplished by cloning a structure relative to an entity with /execute. The entity, in plow, can be controlled by another means.
/summon command [ ]
Using the /summon command, it is possible to lift an entity with explosions, somewhat similar to real life rockets. This can be done past spawning instantly detonating creepers or TNT below an entity. Withal, in that location is a multitude of disadvantages, including:
- It is noisy and potentially laggy compared to nigh other types of flying.
- This method is subversive to the terrain. Using creepers without mobgriefing enabled could solve this.
- Damage to the entity being flown. This can exist partially solved with Blast Protection, condition effects or the Invulnerable NBT Tag..
/data (merge/modify) [entity] command [ ]
Using the /information command (one.13+), information technology is possible to change the velocities applied to an entity rideable by the player, such every bit minecart or boat. The equivalent control for versions below 1.13 is the /entitydata command.
Teleportation/Transport [ ]
Through /teleport, one tin can create teleporters for public use on a server. It tin can be applied to a range of scenarios. For example, i could brand a system of portals in a especially big earth in which all portals link to a key hub, which contains portals to all other portal locations creating a sort of "Fast Travel Hub" using <Ten> <Y> <Z>
Terminate-Motion Animation [ ]
By using the /clone command with lots of dissimilar copies of it, slightly contradistinct bit by bit, and then just clone the areas into one spot in sequence. That style the player doesn't take to exist teleported, but the mural around them tin can be blithe equally the clone commands re-create the diverse animation "frames" near the player sequentially.
Lottery [ ]
Through /give @r, one tin create a lottery. Keep in listen that now, /give will directly put items into one's inventory, instead of throwing them on the ground in front of the graphic symbol.
As mentioned above one can create a lottery but that lottery is usable past the public. A simple edit can alter that... Beginning create a new objective. (For example: /scoreboard objectives add lottery dummy) So utilise this command on a command block /scoreboard players add <playerName> lottery 1 to enter players into the lottery and then do /give @r[score={lottery=ane..}] to beginning the lottery and only the players chosen can be in the lottery.
Jails [ ]
By rigging a fast clock to a control block executing /teleport , they can force a role player to stay at a certain identify. If they do this it would exist advisable to either turn off commands in their chat settings or practice /gamerule commandBlockOutput false. Using the "Range" and "Minimum Range" parameters, they can have it teleport players dorsum only when they're a certain altitude abroad.
Alternatively, giving the player certain status furnishings at loftier levels using the /issue command tin mimic the effect of a jail. Use /issue requite @p minecraft:slowness <insert duration of issue> 127 to go along the thespian from moving, and /effect give @p minecraft:mining_fatigue <insert duration of outcome> 127 to proceed the thespian from breaking things. If player really want to kicking information technology up a notch, poison the player (employ one of the previous two commands, but replace the kickoff number with 19).
Creative Simply [ ]
Past using the parameter [gamemode=creative], only players in Creative will be affected past the command block.
Fun anti-creative mode trap [ ]
If actor place a repeating command block with "Always Active" choice, they tin can set up /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 sentinel.
Announcements [ ]
By using /me in a control cake 1 tin create announcements that could play even when the admin or owner wasn't there.
Security Scan [ ]
By using /clear, players can browse people for items. If they want to remove certain items, use /clear <playername> <itemid>. For instance, on a server that doesn't want griefing, players could have a clock connected to a command block prepare to /clear @a minecraft:flint_and_steel.
Race Referee [ ]
Using /say @p, the control cake can report the nearest actor. If the command block is placed after a finish line, it will say the finishers in order. Players can as well exercise /tellraw @p {"text":"THIS IS A MESSAGE"} and when activated the message "THIS IS A Message" will come on the chat system. Players can also color the text using "color" at the end of the next command /tellraw @p {"text":"THIS IS A Bulletin","color":"dark-green"}.
Artistic Area/World Baby-sit [ ]
Creating a "Creative Simply" zone is possible through command blocks, but it is complex and more than of a instance-by-case footing. The basic idea would exist to create a "argue" of command block affected zones so that, once a thespian flies in creative through information technology, they would be changed to survival or risk fashion. A "World Baby-sit" zone would be a lot simpler, just have a command cake do /gamemode adventure @a[x y z r 1000] and when people exit, merely have a button to alter them to survival.
1 could also utilize the distance statement defining an area-of-event /gamemode chance @a[gamemode=!creative,distance=0..(X)] combined with a deactivating command block /gamemode survival @a[gamemode=!creative,distance=(X+two)..(X+12)]. Set both blocks to echo and be self-powered and there should be a adequately "seamless" transition zone between normal and protected. The altitude variables for the range of effect (specifically the reversion block) tin vary, only a buffer betwixt the 10 and X+two variables should exist there to accommodate the second block existence at a different position than the protection block. The gap between the 2 variables in the reversion block demand not exist exactly ten blocks, but a buffer helps for lag concerns in guaranteeing that once left, a player volition revert back to survival manner.
Do notation that if you have a nether portal within the protection zone, that the player will Non be reverted to survival once they step through, so place a reversion cube of any type (Impulse or Repeating) in the Under on the other side of that portal.
Improving PvP without Plugins [ ]
Players can employ /gamerule keepInventory truthful so players cannot steal each other's items. Also, using /spawnpoint <10> <y> <z> and /teleport <x> <y> <z> to help move players around while in PvP competitions.
Starter Kits [ ]
Players can easily give people a starter kit with a push without plugins: /requite @p[distance=2]. To prevent people pressing the button a 2nd time and again getting their kit, players can make ii command blocks activated in guild: /give @p[distance=2,thou=2] minecraft:stone_pickaxe
/gamemode @p[distance=2] survival
Colorful Messages [ ]
It is possible to create a colored, clickable message players can send to everyone. The command is /tellraw. Not to be confused with /tell. The basic format is /tellraw @a {text:"", color:<color>} An case would be /tellraw @a {text:"Hello, Steve", color:bluish, italic:truthful, obfuscated:true}. Simply place a comma and space with each addition. If you lot want other players to exist able to click it, use clickEvent. Here's the case: /tellraw @p {text:"Run Coward! I hunger!", clickEvent:{action:run_command, value:"/give @p minecraft:cooked_porkchop 64"}}. This ways when the histrion clicks the text, information technology will give them a stack of cooked pork. If yous only want to tell them something without running a command, supplant clickEvent with hoverEvent and run_command with show_text. Then but type the value text every bit a regular sentence, no slashes. If you want an easier job of it, here we have some tools:
- Tellraw Generator one
- Tellraw Generator two
- Skylinerw's JSON Text Component
Warning System [ ]
When a thespian walks over a pressure plate, it tin can trigger a command block with /say <message> or /championship <thespian> title <bulletin>. @p tin be used within the message to display the thespian closest to the control block upon triggering.
Remove Players [ ]
Using coordinate and maximum parameters, players can teleport everyone within a specific area to some other specific area.
Advantage Room [ ]
If a certain player has been very nice, regular, or helpful to the server but non quite meeting the requirements to be promoted to an admin, players could take a room total of buttons continued to control blocks with helpful effects, like giving the helpful actor a stack of diamonds or a bedrock cake, then have it connected to some other command block, sending them to the spawn point. (It is very important this room is reinforced with boulder, hidden, and you lot can simply get in by teleporting to its co-ordinates to avoid abuse).
Weather Auto [ ]
Command: /weather condition <weather condition>
Assuming only admins tin can go to it, a weather machine can be quite useful, players can turn rain on and off at will. One of the more helpful uses of this technique would be to use a combination of villagers (they run within when information technology rains) and some form of redstone machinery to create and automatic rain disabler, this would let you to shut off the pelting near immediately without needing to use the command, or to have an admin present. It can also exist used to create, and/or stop, a scenario where it is more than advantageous to have rain as opposed to sunlight, and vice versa; such equally during a forest burn, or when a thunderstorm is spawning monsters.
Obstruction Class Prizes [ ]
with /teleport @p <x> <y> <z> and /give @p <item>, players could make an obstruction course or maze that when finished will requite a player a prize, and will teleport them back to spawn or some other expanse.
Time Machine [ ]
Past making two like places on one map, players can have a button activate a command block to teleport them from i to another, while also changing the time of day. This can be used to look like fourth dimension travel.
Proximity Mine [ ]
Past using a condition such as /execute if entity @p[distance=..5,name=!<placing player>] run <command> hooked to a brusk clock and one or more than TNT blocks via a comparator, the command block can human action every bit an undetectable proximity mine against all players except the placing player.
Secure Doors [ ]
By using a condition such every bit /execute if entity @p[distance=..5,proper noun=<owner>] run <command>, the control block tin detect a door'south owner within a certain radius and open a door for them, and just for them.
Custom Commands [ ]
By using a trigger objective, players can create commands that players can use on a server.
- Warp control example
Showtime, add the objective: /scoreboard objectives add warp trigger. Place a command block continued to a Redstone clock with the command /scoreboard players enable @a warp. And so place some other control block connected to the clock with the command /teleport @a[score_warp_min=1] <x> <y> <z> [<y-rot> <ten-rot>]. Place a comparator facing away from that control cake, activating a command cake with the command /scoreboard players set @a[score_warp_min=i] warp 0. When a player uses /trigger warp set 1, they will be teleported to (x,y,z) coordinates in the command block.
Application in custom maps [ ]
This section details the applications of the command block in custom maps.
If one wishes to create a singleplayer adventure map, utilise /publish to allow all other commands to be used.
One map that takes reward of a lot of the features of the command cake is the Hypixel's Gladiator Arena in which the fighting organisation is almost only based on this.
Silent Control Cake [ ]
Sometimes it'south important in a map to keep the control blocks silent, may it be to keep the magic of the suddenly appearing items in the inventory, or because the channel telling that the player was teleported, information technology can break the mood of a map. To keep them silent (except when you inquire them to speak), simply use the post-obit: /gamerule commandBlockOutput false
Safe Haven/Arena Fight Zone [ ]
Using pressure plates or tripwire, make areas (like a castle for case) a unlike difficulty (in this case peaceful). the doors could take tripwire hook to a command block that changes ones difficulty to peaceful, creating a sort of "Safe Haven". 1 could as well practise it the other way around, creating a more dangerous zone, such as arenas having the difficulty of hard, rather than normal or easy. Note that in multiplayer this volition change the difficulty everywhere in the world, and thus may non be desirable.
Detecting Cheaters [ ]
Using parameter [gamemode=artistic], the player can bear on those who are in Artistic, or Survival with parameter [gamemode=survival].
It's bigger on the inside [ ]
This is a simple 1, just accept a arrangement of teleporting command blocks at the entrance/exit of a identify, and players tin can build the interior somewhere else, assuasive them to cheat space restriction. (example of use: you want interior walls to exist wool, only exterior walls to exist wood (normally 2m thick walls). Y'all tin can make the exterior of the firm exist 8x10 m, and the inside of the business firm be 8x10 m.) Or, have the inside of the business firm twenty×20 instead.
Salve game [ ]
Past using the /spawnpoint command, i can hands make a button-activated checkpoint.
Lava parkours [ ]
As said earlier, there is a command that makes the thespian able to go along their inventory upon decease: /gamerule keepInventory true. But connect this to a pressure plate before a parkour level over lava and y'all don't take to utilize any kind of chest minecart (particularly useful when the role player has it's full inventory, which is bigger than a single chest).
Still want a bed? [ ]
It's true that the /spawnpoint command can exist useful because you don't take to wait for the nighttime to create a checkpoint, simply sometimes you may want to have a BUD switch connected to the bed or something like, then that you don't accept to type the control in every time. To practice this, yous but need to have a discreet pressure plate connected to a block with the /time gear up 18000 command, and it will set the fourth dimension to dark so the player can sleep.
Time and weather post-obit the scenario [ ]
Many times, a player will exist building something, and it will offset raining or start to get dark, which both can be agonizing to the player. Fortunately, y'all can use commands to plough off the rain, as well as make the sun become back to sunrise. To toggle rain on and off, just use the /weather control. Use clear if you want to clear the weather, or rain or thunder, if you would like to toggle on rain or a thunderstorm. For example, if you want the atmospheric condition to be rain but non thunder, type in the /weather pelting command.
Along with this, you tin can likewise use /time set with a number: 23250 is sunrise, 6000 is midday, 12750 is sunset and 18000 is midnight. So, if you want to set the time to sunrise, type in the conversation: /time set 23250.
Detecting Players who switched to Peaceful [ ]
- Annotation: The difficulty for a specific world can be locked as of Java Edition 1.8.
Create a hostile mob (so it disappears when switching to Peaceful) that never despawns if the player is far away. To practise so, employ a name tag on the mob (or 3rd party software if you are playing in a version previous to 1.5.2) and place it on a force per unit area plate. Make sure it will keep information technology pressed infinitely, so make sure surround it with 2 high blocks or fences, so that information technology can't jump or walk away. Make a redstone circuit that causes a command block to activate when input from pressure plate ceases to be. Identify a message within the block that informs the player on chat that the map has been broken and must be redownloaded. This way, switching to Peaceful will cause the mob to vanish and actuate the message. You can even brand a teleportation command cake and so that a cheater is banished from the map to a minor room without a style out equally soon every bit they switch to Peaceful.
Talking Gamble Map [ ]
The /say control is extremely useful because it just prints text into the conversation. Information technology may exist one of the better uses of the Command Block as you don't need featherbrained signs or long books to show the game rules. Just put a agglomeration of command blocks in lines with repeaters fix to two or three ticks (to avert spamming players) allowing you to easily remove a breast of books or a big number of signs.
Another use of /say is talking NPCs and other mobs. Imagine you enter a butchery and you want the butcher to say something. Unremarkably, y'all might utilise signs or books, using up room in the abattoir and having seemingly random objects strewn effectually a map. With the /say command you can make the butcher talk. Possibly a grunter behind the counter could even beg for mercy! Let'southward accept another example: you lot are in a factory and an alarm all of a sudden rings and says in conversation it will explode. Having it in the chat, especially if the text is long, keeps the stressful mood; the aforementioned thing works for bomb timers. The situation might feel tenser if the chat displays 'x..' 'ix..' 8..' individually as well.
Last only not least, it makes information technology easier to create a Quest System. Let's say the player gets in a butchery. Information technology activates through a pressure plate connected to a RS NOR Latch (to avoid activation twice) and a command cake with the /say command in which the butcher asks for the player's help: they demand to kill a pig. The actor gets to the hog that is standing on a stone pressure plate, that turns off when the pig is expressionless. So, when the player gets dorsum to the butchery, it activates another circuit containing even so another RS NOR Latch and two control blocks with two commands. First, the /say command in which the butcher thanks the player, and another one, the /give control, so the thespian gets the reward. Along with that, don't forget to use the @p command and so the butcher says the player's name. For case, if the command block is gear up to do this: /say Thanks, @p. Yous helped me a lot killing that sus scrofa., the channel will say: "[@]: Thanks, <proper name of the player>. You helped me a lot killing that pig." This increases immersion into the map, as the NPCs seem tailored for the player. You lot could also alter [@] to [Butcher] past renaming the /say command block using an anvil.
Making a Store [ ]
By using /give @p[level=<level>..] <particular> <amount> and /feel add @p[level=<level>..] -<level> levels you can make a shop system that trades a certain corporeality of exp for items. For instance, if you made a control block with /give @p[level=5..] grass_block 64 and another with /feel add @p[level=five..] -5 levels connected to the same redstone current, it volition take 5 levels from the player, and in return, give them 64 grass blocks.
- Subtracting experience can piece of work every bit a currency, by using the command
/experience add @p[level=iii..] -3 levels. The minimum experience for the command to piece of work can exist listed inside the brackets.
Custom villagers selling whatever you lot want can exist created with control blocks. Custom villagers are non available through Minecraft: Boulder Edition.
eastward.g.: /summon villager ~-2 ~0 ~0 {Profession:3,CustomName:BLACKSMITH,CustomNameVisible:0,Offers:{Recipes:[ {maxUses:13,purchase:{id:388,Count:5},sell:{id:283,Count:i,tag:{ench:[{id:16,lvl:9},{id:20,lvl:six}],display:{Name:Molten Gold Sword}}}},{maxUses:13,buy:{id:388,Count:one},sell:{id:280,Count:1,tag:{ench:[{id:sixteen,lvl:5}],display:{Name:Whuppin Stick}}}},{maxUses:13,buy:{id:388,Count:two},sell:{id:369,Count:1,tag:{ench:[{id:sixteen,lvl:5},{id:20,lvl:10}],display:{Name:Radioactive Whuppin Stick}}}},]}}
The part labeled "Buy" is what the villager is accepting every bit payment, the part that says "sell" is what he'southward giving in return. You tin can change the maxUses to 1000 if you never want the offer to run out, or to 1 if you lot want to make it a ane-of-a-kind item. Note that the commencement particular there (the gold sword) has an out of range enchantment (sharpness 9). Yes this works, only always inquiry what exactly the enchantment does before making an out of range one as some stuff does zero or fifty-fifty does negative effects (respiration'south "see underwater" side effect makes everything a blinding white at high levels, as if you pigeon into slush-filled arctic waters). Equally for that gold sword, keep in mind that gold swords vesture out insanely fast (there's a reason people call them butter swords afterward all). A level x Unbreaking enchantment should bring a gilt sword up to a decent durability level. Besides notice that the other 2 "weapons" are actually a Stick and a Blaze Rod with weapon enchantments on them. Using any non-weapon as a weapon does the same damage as an empty hand (one impairment, aka half a heart) but the enchantments on these ones make them the equal of an unenchanted sword. The advantage is that sticks, blaze rods, or other items is that you lot tin can use it infinitely. The same play a joke on tin can be used with mob heads and respiration 3 to brand an infinite durability scuba mask.
Spawners [ ]
Command blocks can create spawners using the /setblock command, due east.g.: /setblock ~i ~-one ~0 spawner{SpawnData:{id:zombie,HandItems:[{id:iron_sword,Count:1}]}} Anything that counts as an entity tin be spawned (except a player), which includes all mobs, as well as minecarts, fireballs, arrows, snowballs, ender pearls, custom thrown potions, fireworks, primed TNT, falling sand, cherry-red sand, or gravel, paintings and item frames, feel orbs, and even dropped items of whatever type.
Pig, cow, or chicken spawners can be placed in the butcher's backyard in a hamlet to create a constant meat supply. Eastward.thou.: /setblock ~1 ~-1 ~0 spawner{MaxNearbyEntities:x,RequiredPlayerRange:16,SpawnCount:6,SpawnRange:2,MinSpawnDelay:50,MaxSpawnDelay:200,SpawnData:{id:hog,Passengers:[{id:chicken}]}} Note that the spawner in the last code instance will spawn a craven riding a pig. In that location doesn't seem to be a limit to how many levels of riders yous tin use. For example, you lot could create a chicken riding a grunter riding a cow riding a horse riding a silverfish riding a villager ("Say, that'due south a mighty odd hat you have on, Farmer Brown").
Please note that if you want to use the RequiredPlayerRange tag you take to use the MaxNearbyEntities tag besides. The same matter applies to MinSpawnDelay and MaxSpawnDelay. Lastly, note that the y value used in both of those spawner example codes was ~-one, which (assuming the role player are not flying) will put the spawner in the surface level of the ground at your feet.
If you lot don't want to target a specific player, y'all tin use @a, @p, or @r instead of <histrion>. Keep in mind that you lot tin apply @p (which means closest thespian) in player issued commands as an easy to type ii character replacement for your ain proper noun as the closest player to yous will always be you.
Part 1: The Basics [ ]
This lawmaking will create a zombie spawner 2 blocks from you lot in the 10 direction. Note that the proper name given for mob spawners in this code (minecraft:spawner) is the long version and you tin exit out the minecraft: part.
/setblock ~2 ~0 ~0 minecraft:spawner{SpawnData:{id:zombie}}
This next lawmaking is also pretty basic but it includes the 6 basic parameters that can be set.
/setblock ~0 ~-1 ~-iii spawner{SpawnRange:4,RequiredPlayerRange:16,SpawnCount:4,MaxNearbyEntities:6,MinSpawnDelay:200,MaxSpawnDelay:800,SpawnData:{id:skeleton}}
Notes:
- All times are in game ticks (20ths of a second). 200-800 is 10–twoscore seconds.
- Continue in heed that they are in groups of two and won't work if their partner is missing. SpawnRange requires RequiredPlayerRange (and vice-versa), MinSpawnDelay requires MaxSpawnDelay, and assuming SpawnCount needs MaxNearbyEntities.
- There is also a parameter called "Filibuster" which contains the amount of time before side by side spawn (20 ticks for the first time, any random number it picks betwixt MaxSpawnDelay and MinSpawnDelay every other fourth dimension).
- The coordinates given are ~0 ~-1 ~-3 (and then iii blocks in the negative Z direction from the commandblock'due south electric current position and 1 block downwardly). This presumably will imbed it in the surface of the floor. Keep in mind that a spawners "SpawnRange" setting but applies horizontally not vertically. Vertically it volition only spawn at the aforementioned summit or 1 lower or higher, so imbedding it in the surface of the floor cuts the available spawn area by 2/3rds (simply can help hide information technology). Naturally occurring spawners have their elevation cut past 1/third due to appearing 1 block above the floor instead of 2.
- All the values used here are the defaults.
Function two: Custom monsters [ ]
The side by side affair to exercise is to modify the spawn data. Spawn data is what tells the spawner yous want a non-standard version of a monster, such as a zombie with a diamond sword and a concatenation helmet.
/setblock ~ ~1 ~ spawner{SpawnData:{id:zombie,HandItems:[{id:diamond_sword,Count:1}],ArmorItems:[{},{},{},{id:chainmail_helmet,Count:1}]}}
Using ~ without whatever number after it in the coordinates counts every bit zero. Because of the fact that none of those 6 parameters from the last example are used, they will all be defaults.
Note that there are now two types of item slots, Hand and Armor. Manus items are in the gild Mainhand, Offhand, while armor items become in the guild Boots, Legs, Breast, Helmet. You must even specify empty slots (the { }, parts), unless they're afterwards the terminal non-empty slot. So, if you want your custom mob to accept a helmet, yous have to specify all v slots, just if it'due south just boots, y'all can leave off the other 3. Also, if y'all want them to take leg armor. y'all have to specify the kicking slot, but not chest and helmet slots.
Recollect that creatures that fire in sunlight are safety if they have a helmet on, although it damages the helmet instead.
As for the count tag, nigh codes can become away with leaving it out; even so, information technology is of import. An item without a count tag is a stack of zero, better known in the community equally a "Ghost Item". A player trying to employ a ghost item will have it disappear out of their hands with its first use (which is a failure). While monsters can utilize ghost items without trouble (hence why codes go away with leaving it out sometimes), if they drop the items the player who picks it upwardly won't be able to use information technology, and so it is highly recommended to utilize the count tag.
The adjacent case of customized monsters, consists of a skeleton with an enchanted bow (Flame) with a custom mob caput (Spider, internet connection required or it's just Steve) with Protection two riding a Skeleton Horse.
/setblock ~2 ~1 ~2 spawner{SpawnData:{id:skeleton_horse,Tame:1,Passengers:[{id:skeleton,HandItems:[{id:bow,Count:1,tag:{Enchantments:[{id:flame,lvl:1}]}}],ArmorItems:[{},{},{},{id:player_head,Count:1,tag:{Enchantments:[{id:protection,lvl:2}],SkullOwner:MHF_Spider}}]}]}} supercede
As of 1.12, passengers can control their mounts to an extent, which means that erstwhile issues with Zombie passengers are no longer extant. A more than in-depth look at the behavior of passengers and mounts can be found at Tutorials/Summoning Jockeys.
The skeleton equus caballus has Tame set to 1 (yes). Notation that there is currently an ongoing bug where summoned mobs riding horses with saddles cannot movement, regardless of whether the equus caballus is tame. Technically you tin can take multiple levels of riders, although this gets silly chop-chop.
Role iii: SpawnPotentials [ ]
Using the SpawnPotentials tag, you can create a mob spawner with multiple mobs in information technology. It will randomly pick one each fourth dimension when the timer is reset (a second after spawning the previous mobs). Since these codes contain multiple mobs, they tend to be quite long codes. Here's a version of the SpawnPotentials code, that is easier on the centre:br>
/setblock ~ ~i ~1 spawner{SpawnRange:6,RequiredPlayerRange:12,SpawnCount:1,MaxNearbyEntities:vi,MinSpawnDelay:100,MaxSpawnDelay:600,SpawnData:{id:"zombie",HandItems:[{id:"wooden_sword",Count:one},{}],ArmorItems:[{id:"leather_boots",Count:1},{id:"leather_leggings",Count:1,tag:{brandish:{colour:5013401}}},{id:"leather_chestplate",Count:1,tag:{display:{colour:6717235}}},{id:"player_head",Count:1,tag:{SkullOwner:Reimac}}]},SpawnPotentials:[{Entity:{id:"zombie",HandItems:[{id:"wooden_sword",Count:one,tag:{Damage:58}},{}],ArmorItems:[{id:"leather_boots",Count:1},{id:"leather_leggings",Count:1,tag:{brandish:{colour:5013401}}},{id:"leather_chestplate",Count:1,tag:{display:{color:6717235}}},{id:"player_head",Count:1,tag:{SkullOwner:Reimac}}]},Weight:4},{Entity:{id:"skeleton",HandItems:[{id:"iron_sword",Count:1},{}],ArmorItems:[{id:"leather_boots",Count:1,tag:{display:{color:1644825}}},{id:"leather_leggings",Count:ane,tag:{display:{color:1644825}}},{id:"leather_chestplate",Count:1,tag:{display:{color:1644825}}},{id:"player_head",Count:1,tag:{SkullOwner:2insanepeople}}]},Weight:2},{Entity:{id:"zombie",HandItems:[{id:"stone_sword",Count:1},{}],ArmorItems:[{id:"chainmail_boots",Count:i,tag:{Enchantments:[{id:"protection"}]}},{id:"chainmail_leggings",Count:1,tag:{Enchantments:[{id:"protection"}]},{id:"chainmail_chestplate",Count:1,tag:{Enchantments:[{id:"protection"}]},{id:"player_head",Count:1,tag:{SkullOwner:Flixnore}}]},Weight:4},{Entity:{id:"zombie",Fire:2400,HandItems:[{id:"golden_sword",Count:1,tag:{Enchantments:[{id:"dial",lvl:1}]}},{}],ArmorItems:[{id:"golden_boots",Count:1},{id:"golden_leggings",Count:1},{id:"golden_chestplate",Count:1},{id:"carved_pumpkin",Count:1,tag:{Enchantments:[{id:"protection",lvl:2},{id:"fire_protection",lvl:ten}]}}]},Weight:4},{Entity:{id:"zombie",HandItems:[{id:"iron_sword",Count:1,tag:{Enchantments:[{id:"sharpness",lvl:ii}]}},{}],ArmorItems:[{id:"iron_boots",Count:i},{id:"iron_leggings",Count:one},{id:"iron_chestplate",Count:1},{id:"player_head",Count:one,tag:{ench:[{id:0,lvl:ii}],SkullOwner:2zqa}}]},Weight:4},{Entity:{id:"zombie",HandItems:[{id:"diamond_pickaxe",Count:1,tag:{Enchantments:[{id:"sharpness",lvl:4},{id:"knockback",lvl:4},{id:"bane_of_arthropods",lvl:4},{id:"looting",lvl:3},{id:"unbreaking",lvl:three}]}},{}],ArmorItems:[{id:"diamond_boots",Count:1,tag:{Enchantments:[{id:"fire_protection",lvl:iv},{id:"feather_falling",lvl:4}]}},{id:"diamond_leggings",Count:one,tag:{Enchantments:[{id:"blast_protection",lvl:4}]}},{id:"diamond_chestplate",Count:1,tag:{Enchantments:[{id:"protection",lvl:4}]}},{id:"player_head",Count:1,tag:{SkullOwner:MHF_Herobrine,Enchantments:[{id:"protection",lvl:four},{id:"fire_protection",lvl:4},{id:"blast_protection",lvl:4},{id:"thorns",lvl:three},{id:"respiration",lvl:1}]}}],CustomNameVisible:1,CustomName:'"Herobrine"',PersistenceRequired:one},Weight:one}]} Information technology contains a lot of codes, considering of the fact that it is really 6 carve up mobs. In order we accept:
- Before the "SpawnPotentials" tag: The starter, which will never popular up again after the start time. If you want to see him over again, you take to include him a second time nether SpawnPotentials. Its appearance is but a random person in blueish jeans (blue dyed leather leg armor), and a green dye shirt (light-green dyed leather tunic), with a wooden sword. He's a zombie under that mob head of it, of form.
- Aforementioned thing, only this time, the wooden sword is two hits away from breaking.
- The side by side one has a ninja-like appearance. This 1 is a skeleton nether its mask, but he'due south been given an fe sword. All of its leather armor is dyed ninja-black. Skeletons with swords shut the gap quicker than zombies, and then picket out.
- Zombie with a stone sword and chain armor, with Protection II on its mob head.
- The next one has a gold sword, gilded armor, a pumpkin on its head, and he's on fire! The pumpkin is enchanted with Protection 2 and Burn down Resistance 10 in a desperate attempt to keep him on its anxiety and threatening the thespian for more than 5 seconds. It works, but if the player plays keep away then the zombie does tend to burn down to decease. Its sword has fire attribute also.
- Fe Sword and Armor. Sharpness 2 on its sword, Protection II on its mob head.
- The final mob, faux Herobrine, here has highly enchanted diamond armor (boots with Fire Protection 4 and Plume Falling Four, leggings with Blast Protection Iv, a chestplate with Protection Iv, a mob caput with Protection IV, Burn down Protection Four, Blast Protection Iv, Respiration III) and a diamond pickaxe enchanted with Sharpness Four, Smite 4, Blight of Arthropods IV, Annexation III and Unbreaking III. Its likewise got the previously unseen CustomNameVisible (set to 1 for yeah), a CustomName, and PersistenceRequired (prepare to ane for yes). That last one will forbid information technology from always despawning, although information technology can be killed normally. If you can get through that diamond armor and level 4 resistances.
Other than the ninja, it's a straight bout of the 5 tiers of swords and armor. Notation that the Weight tag, used right after the Entity tag in each SpawnPotential. That determines how rarely information technology'due south picked. Specific numbers don't mean annihilation, just the ratios between the numbers. For instance, if you want all the potentials to take an equal chance only set all the weights to ane. Changing them all to 8 wouldn't do anything dissimilar (they're still all the same size as each other), however, changing all but one to 8 would make that one 1/eighth equally probable as the rest. In this code, iv is the default. The ninja just has a weight of 2 (making him half as likely to be picked) and fake Herobrine has a weight of 1 (making him 1/quaternary equally likely to be picked, and thank god!)
Part four: Rideable Monsters [ ]
Mobs tin can be ridden by using Minecarts or Boats on their heads. The command is adequately simple:
/setblock ~ ~1 ~ minecraft:spawner{SpawnPotentials:[{Entity:{id:"<Entity>",Passengers:[{id:"minecraft:minecart"(or "minecraft:gunkhole")}]}}]}
Tips:
- Bosses can also be spawned with a spawner. Calculation a minecart is as well possible.
- Hostile mobs with shooting abilities tin can and volition use them against survival players. Spotter out.
- Although the minecart would stuck in their caput, ghasts can also be ridden. Nevertheless, you may demand an elytra or a trident enchanted with riptide to practise that.
- Endermen cannot be walked around, but they can be forced to teleport by shooting a projectile at them (e.g.; snowball).
- Ocelots are some of the fastest mobs to ride, seeing they're trying to become away from you. They tin can as well be partially controlled, past pointing abroad from the identify you desire to go.
- Spiders are the just mobs that slow downwards when ridden.
- Slimes and their Nether cousins, magma cubes, can have their sizes changed.
More commands in fewer command blocks and recursion [ ]
There are several ways to combine groups of commands into just one command.
Apply the following sets of commands for recursion:
/scoreboard objectives add counter dummy
/scoreboard players set target_count counter <target count>
/execute if score count counter < target_count counter <chained command>
/execute unless score count counter < target_count counter run scorebard objectives remove counter
/scoreboard players add together count counter one
To run multiple commands, summon a command-block minecart riding another command-block minecart riding another, with the commands in reverse gild, on an activator rails. At that place are also commands called one-command tool that use this tactic.
Using a map item as a scroll [ ]
A YouTuber called SethBling used a map every bit a scroll to perform commands (summon creatures, teleport). The histrion will have an empty map in the inventory and when the thespian uses it, it becomes a filled map which immediately disappears and a redstone chore is done.
Pros
- Fast redstone interaction.
- Compact system.
- At-will triggered system, just correct-click to activate information technology.
- Single use: the map disappears during the inventory check, simply you can requite it back through
/give.
Cons
- In that location can just exist ane purpose for the roll, i.e. players cannot do a scroll of teleporting and a curl of strength without using complicated data values.
- The player may see the map animation when activating the map before it gets deleted.
- The histrion cannot use the map particular during your playthrough (showing a text message, a path, a drawing, …).
Building the mechanism
The player can alter the display name of an detail to give the player a ameliorate understanding of the object and use the tooltip display. Utilize the post-obit command to give the histrion a custom named map: /give <thespian> map{display:{Name:"<displayName>",Lore:["<tooltip>"]}}
- role player: the histrion you want to achieve (@p, @a[arguments],...).
- displayName: the name displayed when y'all gyre in the hotbar or when you hover the detail with your mouse.
- tooltip: the text below the item name when you hover it.
Detecting the activation of the map
- The two hoppers form a redstone clock. You lot can use other clocks shown here.
- The Command block i contains the
/givecontrol described in the section above. Information technology can be dismissed if the actor doesn't desire the whorl to come up back after being activated. - The Command cake 2 contains the inventory bank check control:
/articulate <player> filled_map
- The Command block 3 is the output in case of success. Yous can do any you want: give an effect to the role player, teleport him somewhere,... You can too wire this output to a door, a piston,...
Going further The /clear command tin can cheque for other interactive items:
- Check for a glass canteen if the thespian just drank a potion.
- Check for a angling rod when the line is reeled in. The
/clearsyntax involves another argument, the damage value, after the particular name:
/articulate <player> fishing_rod{Damage:2} Note that spamming the reel, or hooking a mob, may damage it more than than 2, and so make another one of these every 2.
Farther reading [ ]
- Feare'southward Command Cake Tutorials (Not Found)
- Dragnoz' YouTube tutorials to a lot of possibilities using data tags (Out of date)
Video [ ]
This section needs expansion.
You can help by expanding it.
Instructions: more advanced uses of commands
See also [ ]
- Tutorials/Command NBT tags
lightnerfeent1962.blogspot.com
Source: https://minecraft.fandom.com/wiki/Tutorials/Command_blocks_and_functions
Belum ada Komentar untuk "Minecraft How to Make It So You Can Place an Item Only on a Certain Block 1.13"
Posting Komentar