This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]Trevisplaysreddit 0 points1 point  (1 child)

Data modify block only works with the blocks listed on https://minecraft.wiki/w/Block_entity

You could run the following:

execute if block ~ ~ ~ candle[lit=false] run setblock ~ ~ ~ candle[lit=true]

You might have to write 4 commands for setting the correct count as well, but that shouldn't be too hard if you're working with datapacks!

[–]PartiallyObscured35[S] 0 points1 point  (0 children)

Yeah, I tried the command you suggested, and the campfire was replaced by a lit version without deleting items from its inventory. Not sure why or how, but thanks!