0

I have this code in datapack:

execute as @a at @s if block ~ ~-0.05 ~ minecraft:grass_block run effect give @s minecraft:instant_damage 1 1 true

execute as @a at @s if block ~ ~-0.05 ~ minecraft:dirt run effect give @s minecraft:instant_damage 1 1 true

execute as @a at @s if block ~ ~-0.05 ~ minecraft:stone run effect give @s minecraft:instant_damage 1 1 true

I want the player to not take damage from a block that they have personally placed. How is it written?

I don't understand Java, I'll be glad if someone can help.

2
  • 1
    Could you explain it a bit in detail as to what you want to achieve? Is it that the player will always take a certain amount of damage per second unless they are standing on specific blocks? O
    – hfanatic
    Jan 30 at 16:12
  • 1
    In my datapack, if a player is on certain blocks, they take damage. But I need that if the player himself personally puts any of these blocks, he does not receive damage. That is, if the block is placed by the player - the damage should not pass, if by minecraft itself - the damage passes. Sorry if it's written incorrectly, I don't speak the language very well)
    – Mirnoy F
    Jan 30 at 16:43

0

You must log in to answer this question.

Browse other questions tagged .