I can't find a specific mob's health



  • I am trying to check a PVP bot's health, except every time I try to. it says it can't. Here is my current command:

    /execute if entity @e[name=Skeleton] [nbt={Health:10.0f}] run setblock 49 157 81 redstone_block 
    

    Here is the error message:

    Incorrect argument or command ...Skeleton] (red text starts here) [nbt={Health:10.0f}] run setblock 49 157 81 redstone_block*

    I've tried playing around with the command, asking friends, and now I'm here, so please help.
    Version: 1.19.2.



  • Try this:

    /execute if entity @e[name=Skeleton,nbt={Health:10.0f}] run setblock 49 157 81 redstone_block

    It worked in my test world. Your problem was that you needed a comma between [name=Skeleton and nbt={Health:10.0f}] instead of a space and brackets



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2