@e procedure block

Started by PythonIsCool on

Topic category: Help with MCreator software

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@e procedure block

So I'm trying to figure out a way for a mob to give *255 slowness on every single entity except it and the closest player next to it. I think I know how to do this (if you could explain how you'd do that that'd be nice) but what I need to know is where to pick @e in the coding. I don't see it anywhere, it just tells me event/target entity which idk what that means

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In the meantime, you can use…
Sat, 11/14/2020 - 15:07

In the meantime, you can use a normal Minecraft command with @e in it. In this case, these three commands should do what you want: 

effect give @e minecraft:slowness 100 255

effect clear @p minecraft:slowness

effect clear @s minecraft:slowness

These commands will give all the entities slowness, then remove the slowness from the nearest player and the entity executing the commands. If you just make these three commands run in the name of the entity, it should do as you want.

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah that's what I do right…
Tue, 11/17/2020 - 23:36

yeah that's what I do right now but id rather not have to force the player to have commands

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't think the player…
Thu, 11/19/2020 - 01:52

I don't think the player needs commands enabled to  run commands with procedures, but I haven't ever tested that. Anyways, now that 2020.5 is officially released, you can do this with entity iterators.

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Explain entity interators…
Thu, 11/19/2020 - 11:47

Explain entity interators please?

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well, there's a new block in…
Thu, 11/19/2020 - 22:06

Well, there's a new block in the World management tab called For each entity as (Entity iterator) at (xyz) in square cube with size (4) do. You can then get a block called Entity Iterator from the Minecraft components and do anything you want with it that you could do with any other entity. However, MCreator will run that code for all of the entities within a 4 or whatever number you put block range around the block at xyz. That might sound a bit confusing, but you can basically just run code for each entity within a certain area. Here's a procedure that does what you want using the new Entity Iterator:

https://drive.google.com/file/d/14OQb1NwQziUNDfK5q9SsdSSwiKgmDXwE/view?usp=sharing

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It’s not. I can definitely…
Fri, 11/20/2020 - 01:04

It’s not. I can definitely use this to incorporate range into the stands I make, since for now they’re just everywhere. Is there a way to use this to keep a mob near you? And they can’t go out of range?

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well if it's a custom mob, I…
Fri, 11/20/2020 - 01:52

Well if it's a custom mob, I'm pretty sure there's an AI block that makes it follow players. I don't think you would want to do this by looping through all the entities.

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so in other words I have to…
Tue, 12/01/2020 - 13:41

so in other words I have to tame it for it to follow me in x range. Great. I was hoping that it wouldn't be like that, since I wanted that on SPAWN it would be tamed, and that it would not be allowed to go out of that range. 1/2 aint bad.