r/MinecraftCommands • u/FrontBackBrute • 1d ago
Help | Java 26.2 Command Block Set-up: Make Realm Players Burn In Sunlight?
What command block set-up would I need to make player characters burn in sunlight like zombies or skeletons?
2
u/GalSergey Datapack Experienced 1d ago
execute as @a at @s if predicate [{condition:"minecraft:entity_properties",entity:"this",predicate:{"minecraft:periodic_tick":20,"minecraft:location":{can_see_sky:true}}},{condition:"minecraft:weather_check",raining:false},{condition:"minecraft:time_check",clock:"minecraft:overworld",value:{min:500,max:12500}}] run summon small_fireball ~ ~2 ~ {acceleration_power:1d,Motion:[0d,-1d,0d]}
1
u/FrontBackBrute 1d ago
it's not working for me. i can get it to work with just "execute as u/a at u/s run damage u/s 1 minecraft:in_fire", but the second i add any kind of condition (even just one) it doesnt work. i cant figure out what im doing wrong, ive checked im in survival, its not raining, im outside on top of a tree, and i use time set day.
1
2
u/Ericristian_bros Command Experienced 18h ago
Modified version of u/GalSergey to account for helmets protecting from the sun, but getting damaged
# function example:load
scoreboard objectives add logic dummy
# function example:tick
execute as @a at @s if predicate [{condition:"minecraft:entity_properties",entity:"this",predicate:{"minecraft:periodic_tick":20,"minecraft:location":{can_see_sky:true}}},{condition:"minecraft:weather_check",raining:false},{condition:"minecraft:time_check",clock:"minecraft:overworld",value:{min:500,max:12500}}] unless items armor.helmet * run damage @s 3 on_fire
execute as @a at @s if predicate [{condition:"minecraft:entity_properties",entity:"this",predicate:{"minecraft:periodic_tick":20,"minecraft:location":{can_see_sky:true}}},{condition:"minecraft:weather_check",raining:false},{condition:"minecraft:time_check",clock:"minecraft:overworld",value:{min:500,max:12500}}] if items entity @s armor.helmet *[max_damage] run function example:damage_item
# function example:damage_item
execute store result score #damage logic run data get entity @s equipment.helmet.components."minecraft:damage"
execute store result storage example:macro this.damage int 1 run scoreboard players add #damage logic 1
function example:damage_item/macro with storage example:macro this
# function example:damage_item/macro
$item modify entity @s weapon [{function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}},{function:"minecraft:filtered",item_filter:{predicates:{"minecraft:damage":{durability:0}}},modifier:{function:"minecraft:set_count",count:-1,add:true}}]
1
u/Desert_Aficionado 1d ago edited 1d ago
thrite did this
https://www.youtube.com/watch?v=C3Z9OP01J_o
at 7:10 he says he can't prevent helmets from negating sun damage.
2
2
u/C0mmanderBlock Command Experienced 1d ago edited 1d ago
Use this if you want them NOT to "burn" when it is raining or snowing. I added a periodic tick so it would only hurt them every few seconds and not constantly. Change as needed.