Started by
GustavoLank9236
on
Topic category: Advanced modding
I'm trying to make an item, which when clicked gives only effects to nearby mobs, not to players. But the only way I found it to do this was with a procedure that runs a command:
effect @e [type =! Player, r = 5] slowness 30 255.
And who runs the command is the player, so, if the player does not have permissions and try to use the item, it can not. So, is there any way I can do what I want other than with commands, or make it not the player that runs the command?
I used google translate, so sorry for the bad english.
This is not possible as command needs a source that executed it. Command blocks act as own source of commands but this is a complex system with server-client communication. So I think this will not be added anytime soon. I think that most of the features can be implemented using the procedure system alone without commands.
Okay, but how would I make all mobs (except players) in a certain distance gain the effect with procedures, without commands? Or is this impossible?
Well, this would not be possible right now, unfortunately. I hope we will manage to improve this in the future though.
You have to use the !player:
effect give @e[type=!player,distance=0..5] minecraft:speed <time of duration> <strength of the potion> true/false
I need something like this, I made a nuke, and I want the explosion to give a poison effect if a player is in a radius of 150 blocks from the explosion's epicenter, so I ran the following command with the execute procedure block:
/effect give @a[distance=..150] minecraft:poison 30 1 true
The problem is that the radiaction area is not applied based on the explosion's epicenter, but the player's X Y Z Coordinates.
Is there any way of making a command execute from a specific block location?
Or maybe spawning a command block with the code already in it?
Or literally any way for this to work?