How to correctly use the agent selector (@c)?



  • I'm new to Minecraft commands, so this may be a very dumb question.

    I was playing with the NPC dialog, adding some random commands to understand how they work.
    I first tried to give something to myself, and it worked as expected:

    /give @s camera 1
    

    Then I tried to give something to the agent:

    /give @c carrot 5
    

    but I got an error:

    Selector must be player-type.

    What I understand is that the agent is considered an entity. So far, so good.
    So... what exactly can I do with the agent selector @c then? Am I able to interact with my agent using commands?

    PS:
    Apart from /kill and /teleport.



  • /give is not compatible with the Agent, however, /replaceitem is. Use /replaceitem instead to add items to your Agent's inventory with commands:

    replaceitem entity @c slot.inventory 0 carrot 5
    

Log in to reply
 


Suggested Topics

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