Started by
PythonIsCool
on
Topic category: Help with MCreator software
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
2020.5 will support this
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.
yeah that's what I do right now but id rather not have to force the player to have commands
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.
Explain entity interators please?
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
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?
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.
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.