SKRIPT VERSION: 2.3.2 (since I'm too lazy to update)
SKRIPT AUTHOR: Bensku: Leading Continuation of Skript
MINECRAFT VERSION: 1.12.2
Hello, I'm Corman. I currently face an issue on how to make an alternative entity targeting system.
This is the code I've had with NO ERRORS. However, the code had errors when I tried to make an alternative targeting system. My goal is to make an entity target another entity which meets these conditions:
- The entity is NOT a player
- The entity is in a radius of 50 from the first entity
- The entity is a mob
- The entity does not contain the first part of its the main entity's name
(This means if it is "CormanYT Doubler" it cannot target "CormanYT Skeleton")
- If the entity is a villager and there are other entities to choose, pick those entities first.
This might seem a bit confusing to people who don't get what I'm trying to accomplish, so here's some example code that shows what I'm trying to accomplish (although it isn't working code).
I got no help from the Skript Discord, tried as much as I could on my own, and there's no really anything on the docs. If someone could help me, please do. I can explain this further if I have to.
SKRIPT AUTHOR: Bensku: Leading Continuation of Skript
MINECRAFT VERSION: 1.12.2
Hello, I'm Corman. I currently face an issue on how to make an alternative entity targeting system.
Code:
on entity target:
if entity's name contains "%entity's target%":
cancel event
delete entity's target
- The entity is NOT a player
- The entity is in a radius of 50 from the first entity
- The entity is a mob
- The entity does not contain the first part of its the main entity's name
(This means if it is "CormanYT Doubler" it cannot target "CormanYT Skeleton")
- If the entity is a villager and there are other entities to choose, pick those entities first.
This might seem a bit confusing to people who don't get what I'm trying to accomplish, so here's some example code that shows what I'm trying to accomplish (although it isn't working code).
Code:
on entity target:
if entity's name contains "%entity's target%":
cancel event
delete entity's target
loop all entities in radius 50 of entity:
loop-entity isn't a player
set {_this::*} to entity's name split at " "
loop-entity's name doesn't contain "%{_this::2}%"
loop-entity is a mob
if loop-entity is a villager:
set {_villager} to loop-entity
else:
set {_entity} to loop-entity
if {_entity} is set:
set entity's target to loop-entity
else if {_villager} is set:
set entity's target to loop-entity
I got no help from the Skript Discord, tried as much as I could on my own, and there's no really anything on the docs. If someone could help me, please do. I can explain this further if I have to.