0

Is there a way that I can freeze all mobs using a command, then test for a player getting on a boat, then unfreeze all the entities? If you are curious as to why I would be wondering this, here is a link to one of my other questions: Making mobs invincible

  • So I understand what it is you want to do, you want your bats to be motionless until someone gets in a boat that's riding said bat? Rewording your question to better reflect your general problem might yield better answers. – MBraedley Apr 27 '14 at 16:34
  • This is a pretty complicated problem, I would suggest freezing all mobs isn't the way to go. Instead possibly spawning a thrown potion of slowness with infinite time as the mob is spawned. Then clearing the effects once you detect the player is in the boat (Still trying to think of a way to detect that) – DBS Apr 27 '14 at 17:31
  • Actually, given how the plane is made, clearing effects would break it. Unfortunately I don't know of any other way to freeze it in place. – DBS Apr 27 '14 at 17:50
  • @DBS actually, I found a way to do this, just give the bat a potion of slowness effect set to 255 for a few seconds to give the rider time to get on. – DatEpicCoderGuyWhoPrograms Apr 27 '14 at 19:31
1

You could use the /effect command to apply slowness to every entity with a really high level and time as such:

/effect @e 2 1000000 255 true

Then when you detect your player in the boat (this is where my knowledge ends), you can clear the effect as such:

/effect @e clear
| improve this answer | |
  • Note that using a straight @e selector is going to cycle through every entity in existence, including those that cannot accept potion effects. A quick way to target only 'living' mobs is to supply the team parameter. For example, leaving it blank (@e[team=]) will target living entities not on a team. Alternatively, the mobs that should be affected could be added to a specific team. You should also be using name IDs instead of numerical ("slowness" rather than "2"). – Skylinerw Jun 5 '16 at 11:54

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.