3

Hi All, I’m trying to create an addon in MCPE 1.16.2 but I’m struggling to do one thing. I want to be able to detect a player with an item on his head and then follow on with another command like giving him effects or a specific item. And when they take it off of their head, the effects/item disappear. There are ways to do it with command blocks like chain and repeat ones but I want to be able to do it all in a function file and I’m kinda new to that; Like does one function file do multiple commands. Like is there a way to do this using an execute command. Please Help.

7
  • Hmm, I don't know exactly how to make it with function files (since I can't do the coding on my phone and I don't know how) so what's best is try to use a repeating command block that gives that certain effect for 1 second when you wear that specific hat. The problem lies how to detect the helmet worn using /execute. – Mark Giraffe Feb 26 at 13:40
  • Do you know any other commands other than the /execute command to detect the helmet as well as following on with that command with like an /effect in only one repeating command block? – DEAN Feb 26 at 14:45
  • @MarkGiraffe how would you use /execute to do this? – Penguin Feb 26 at 16:14
  • @Penguin /execute @a[foo] ~ ~ ~ effect @s foo # # – Mark Giraffe Feb 26 at 17:10
  • @MarkGiraffe what's the selector tho. Saying foo doesn't really tell me anything – Penguin Feb 26 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.