345: Code entry by copying held block to item display. [Minecraft Map Making]

Ойындар

Ep345: Copying the held block of a player to an item display if that item is contained within a block tag list.
Version: 1.20.5
Command help: GalSergey
Commands, builds and ideas for people making their own Minecraft maps.
Check out my collabs on Coppit's channel: / coppitj
Join the CoppitCraft server that I play on and the Discord where I hang out.
Server IP: 51.81.246.145:25588
Discord: / discord
The following commands are prefixed with three letters which represent the settings of the command block. E.g IUN: = Impulse Unconditional Needs_Redstone. These prefixes need to be removed if copying the commands.
Since angled brackets are not allowed in KZread descriptions you will have to replace "greater than" and "less than" with the appropriate angled bracket.
Commands used:
Create Interactions:
IUN: summon interaction ~ ~0.5 ~ {Tags:["code_display", "entry"]}
Create Displays:
IUN: summon item_display ~2 ~1 ~ {Tags:["code_display", "display_1"], item:{id:"stone", Count:1b}}
CUA: summon item_display ~2 ~1 ~ {Tags:["code_display", "display_2"], item:{id:"stone", Count:1b}}
CUA: summon item_display ~2 ~1 ~ {Tags:["code_display", "display_3"], item:{id:"stone", Count:1b}}
Controller:
RUA: execute as @e[type=interaction, tag=entry] on target run tag @s add check_me
CUA: execute as @e[type=interaction, tag=entry, nbt={interaction:{}}] at @s if items entity @a[tag=check_me] weapon.mainhand #minecraft:wool run item replace entity @e[type=item_display, distance=..0.5] container.0 from entity @p weapon.mainhand
CUA: execute as @e[tag=entry] run data remove entity @s interaction
CUA: tag @a remove check_me
Check Win:
IUN: execute if entity @e[tag=display_1, limit=1, nbt={item:{id:"minecraft:red_wool"}}] if entity @e[tag=display_2, limit=1, nbt={item:{id:"minecraft:green_wool"}}] if entity @e[tag=display_3, limit=1, nbt={item:{id:"minecraft:blue_wool"}}] run say Correct!

Пікірлер: 12

  • @GalSergey
    @GalSergey15 күн бұрын

    Hello. In 1.20.5 "Count" tag is now replaced by "count" and now it is int value, not byte value, so it is correct to use "count:1". But it worked for you because now "count" tag is optional, and if not specified it will be set to "count:1" by default. Also you can simply summon code_display, just do as passenger on interaction entity. And lastly, it can be improved/simplified and use only 2 command blocks. You can reset interaction entity using "store success entity @s interaction.player[] int 0" after selecting this entity. Then check if player ("on target") has wool in hand and change item_display with this wool. However, if player is not holding wool, but any other item, then this command will not be executed and interaction entity will not be reset. Therefore, it is necessary to use the same second command, but instead of "if items" use "unless items" and here you have two options: 1) leave the wool as it was - then the command should end with "unless items". 2) set the default wool color, or something like that - then do "item replace entity @s contents with minecraft:white_wool" to replace the wool with white, for example. # Summon summon interaction ~ ~0.5 ~ {Tags:["entry"],Passengers:[{id:"minecraft:item_display",transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]},item:{id:"minecraft:stone"}}]} # Command blocks execute as @e[type=minecraft:interaction,tag=entry] store success entity @s interaction.player[] int 0 at @s on target if items entity @s weapon.mainhand #minecraft:wool run item replace entity @e[type=minecraft:item_display,sort=nearest,distance=...01,limit=1] contents from entity @s weapon.mainhand execute as @e[type=minecraft:interaction,tag=entry] store success entity @s interaction.player[] int 0 at @s on target unless items entity @s weapon.mainhand #minecraft:wool ## or execute as @e[type=minecraft:interaction,tag=entry] store success entity @s interaction.player[] int 0 at @s on target unless items entity @s weapon.mainhand #minecraft:wool as @e[type=minecraft:item_display,sort=nearest,distance=...01,limit=1] run item replace entity @s contents with minecraft:white_wool This way, after the player clicks on the interaction entity, the first or second command will be executed in any case, and the interaction entity will always be reset after the click. P.S. in the video description in the "Create Displays" commands there are random numbers.

  • @InfernalDevice

    @InfernalDevice

    15 күн бұрын

    Thank you very much. Some very handy tips. :) I'll shall pin it for others to see. Oops, those random numbers were left over coordinates from when I was testing. Thank you. :D

  • @vibre8815
    @vibre881515 күн бұрын

    comment for algorithm

  • @InfernalDevice

    @InfernalDevice

    15 күн бұрын

    6: "I see dead people", the little boy said.

  • @the_rahn
    @the_rahn14 күн бұрын

    Cool!

  • @InfernalDevice

    @InfernalDevice

    14 күн бұрын

    I think there are probably better ways to enter codes. Imagine coming home at the end of the day and having to slap your front door with three 1 meter cubed blocks of wool to get in. :D

  • @the_rahn

    @the_rahn

    14 күн бұрын

    @@InfernalDevice Spinning arrows in item frames are a classic, they can even be done with redstone only. Same goes for chiseled bookshelves and named item filters!

  • @InfernalDevice

    @InfernalDevice

    14 күн бұрын

    @@the_rahn I think I have tutorials for all of those as well. :)

  • @jonjoni8460
    @jonjoni846015 күн бұрын

    Hey there! I've recently seen some of your older videos with regard to commands and I find them useful. Specially I've been trying to detect the existence of two DIFFERENT items on the ground, something like this: If blaze powder and nether star on top of soul sand magic happens. I just don't understand how to make it so that the one detects the presence of the other on ONE surface.

  • @InfernalDevice

    @InfernalDevice

    15 күн бұрын

    Hello. :) One of these videos may help you: Ep 125 - Crafting on the floor: kzread.info/dash/bejne/q6igraeSZarMnZs.html Ep 160 - Updated and improved floor crafting: kzread.info/dash/bejne/loyatqV8d6nSfco.html Ep 225 - Floor enchanting: kzread.info/dash/bejne/nJytt9h_kbfReqQ.html

  • @jonjoni8460

    @jonjoni8460

    15 күн бұрын

    ​@@InfernalDeviceThank you for this as well, sorry for the double post, but I was worried you would not see my comment because the video is old! As I said! You earned a new sub! 😊

  • @InfernalDevice

    @InfernalDevice

    15 күн бұрын

    @@jonjoni8460 The algorithm likes the extra comments. :D Thank you very much for the sub. :)

Келесі