424: Hat tag. [Minecraft Map Making]
Membership:
Ep424: The longer you wear the hat, the more points you get. If you get hurt you drop the hat, be careful.
00:00 Intro
01:30 Setup
02:20 Give Hat
04:20 Controller - points
06:35 Controller - drop hat
14:10 Controller - spectate
18:40 Controller - wear hat
22:20 Waffling
Version: 1.21
Commands, builds, hacks and ideas for people making their own Minecraft maps.
Check out my collabs on Coppit's channel:
Join the CoppitCraft server that I play on and the Discord where I hang out.
Server IP: 51.81.246.145:25588
Discord: https://discord.gg/amU84KykEu
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 YouTube descriptions you will have to replace "greater than" and "less than" with the appropriate angled bracket.
Commands used:
Setup:
IUN: scoreboard objectives add points dummy
CUA: scoreboard objectives add timer dummy
CUA: scoreboard objectives add damage_taken custom:damage_taken
CUA: scoreboard objectives add spectate dummy
Give hat:
IUN: give @p leather_helmet[custom_data={tag:hat},attribute_modifiers={modifiers:[{id:"jump_strength",type:"generic.jump_strength",amount:0.15,operation:"add_value",slot:"head"}],show_in_tooltip:false},item_name='{"bold":true,"color":"dark_green","text":"Tag Hat"}',lore=['{"color":"gray","italic":false,"text":"Wear me for points!"}'],unbreakable={show_in_tooltip:false},hide_additional_tooltip={},fire_resistant={},dyed_color={rgb:65535,show_in_tooltip:false}]
Controller - points:
RUA: scoreboard players add #hat timer 1
CUA: execute if score #hat timer matches 20 run scoreboard players reset #hat timer
CCA: execute as @a if items entity @s armor.head leather_helmet[custom_data~{tag:hat}] run scoreboard players add @s points 1
Controller - drop hat
IUN: execute as @a[scores={damage_taken=1..}] at @s if items entity @s armor.head leather_helmet[custom_data~{tag:hat}] run summon item ^ ^1.7 ^1 {Glowing:true, Invulnerable:true, PickupDelay:32767, Item:{id:"leather_helmet"}, Motion:[0.0,0.4,0.0], Tags:["temp_hat"]}
CCA: execute as @a[scores={damage_taken=1..}] at @s run data modify entity @e[type=item, tag=temp_hat, limit=1, sort=nearest] Item set from entity @s Inventory.[{Slot:103b}]
CCA: data merge entity @e[type=item, tag=temp_hat, limit=1] {PickupDelay:0}
CCA: item replace entity @a[scores={damage_taken=1..}] armor.head with air
CCA: scoreboard players set @a[scores={damage_taken=1..}] spectate 100
CCA: gamemode spectator @a[scores={spectate=100..}]
CUA: scoreboard players reset @a[scores={damage_taken=1..}] damage_taken
Controller - spectate
RUA: execute at @a[scores={spectate=100..}] run summon area_effect_cloud ~ ~ ~ {Tags:["lock"], Duration:100}
CUA: scoreboard players remove @a[scores={spectate=1..100}] spectate 1
CUA: tp @a[gamemode=spectator, tag=!dev, scores={spectate=1..100}] @n[type=area_effect_cloud, tag=lock]
CUA: gamemode creative @a[scores={spectate=0}]
CUA: scoreboard players reset @a[scores={spectate=0}] spectate
Controller - wear hat:
RUA: execute as @a if items entity @s inventory.* leather_helmet[custom_data~{tag:hat}] unless items entity @s armor.head leather_helmet[custom_data~{tag:hat}] run tag @s add wear_hat
CUA: execute as @a if items entity @s hotbar.* leather_helmet[custom_data~{tag:hat}] unless items entity @s armor.head leather_helmet[custom_data~{tag:hat}] run tag @s add wear_hat
CUA: clear @a[tag=wear_hat] leather_helmet[custom_data~{tag:hat}]
CUA: item replace entity @a[tag=wear_hat] armor.head with leather_helmet[custom_data={tag:hat},attribute_modifiers={modifiers:[{id:"jump_strength",type:"generic.jump_strength",amount:0.15,operation:"add_value",slot:"head"}],show_in_tooltip:false},item_name='{"bold":true,"color":"dark_green","text":"Tag Hat"}',lore=['{"color":"gray","italic":false,"text":"Wear me for points!"}'],unbreakable={show_in_tooltip:false},hide_additional_tooltip={},fire_resistant={},dyed_color={rgb:65535,show_in_tooltip:false}]
CUA: tag @a[tag=wear_hat] remove wear_hat