So I created a turret which currently attacks all players, I want it to attack only players from other teams and ignore players from its own team. Any suggestion on how I could do that?
I would need something like this:
/execute as @e[tag=turret] at @s run tag @e[team=!turretTeam,distance=..15] add attack
I just need help with creating a "team=!turretTeam" filtering system.
So I created a turret which currently attacks all players, I want it to attack only players from other teams and ignore players from its own team. Any suggestion on how I could do that?
I would need something like this:
/execute as @e[tag=turret] at @s run tag @e[team=!turretTeam,distance=..15] add attack
I just need help with creating a "team=!turretTeam" filtering system.
did you set the team-rule for the team on friendlyfire=false?
The turrets and its players must be in the same team.
Did you implemented them in vanilla?
I would like to know how your turret-system works, could you roughly explain it to me?
Cylo
friendly fire works only if the turret was a real entity and tried to damage another entity in the same team. But my turret is not actually a real entity, it is just an armor stand using effects to damage a target.
Once a player receives a tag called "attack", the turret locks on and summons a "beam" which moves towards the target and damages it once it reaches a specific radius. The turret uses raycasting to shoot at a target meaning that an armor stand is summoned and rotated to face the target, then it is teleported forward until it reaches the target or hits the ground. There is also a scoreboard timer running in the background to act as a cooldown.
I've made a post on reddit regarding this concept and there is also a world download in the comments:
So I created a turret which currently attacks all players, I want it to attack only players from other teams and ignore players from its own team. Any suggestion on how I could do that?
I would need something like this:
I just need help with creating a "team=!turretTeam" filtering system.
Command block engineer // Developer // #TeamTrees
What do you mean a filter system?
Your command looks good atm.
Yeah sorry, I just realized that too.
For some reason, I thought that wasn't implemented.
Command block engineer // Developer // #TeamTrees
Hi Megacrafter,
did you set the team-rule for the team on friendlyfire=false?
The turrets and its players must be in the same team.
Did you implemented them in vanilla?
I would like to know how your turret-system works, could you roughly explain it to me?
Cylo
friendly fire works only if the turret was a real entity and tried to damage another entity in the same team. But my turret is not actually a real entity, it is just an armor stand using effects to damage a target.
Once a player receives a tag called "attack", the turret locks on and summons a "beam" which moves towards the target and damages it once it reaches a specific radius. The turret uses raycasting to shoot at a target meaning that an armor stand is summoned and rotated to face the target, then it is teleported forward until it reaches the target or hits the ground. There is also a scoreboard timer running in the background to act as a cooldown.
I've made a post on reddit regarding this concept and there is also a world download in the comments:
https://www.reddit.com/r/MinecraftCommands/comments/as084t/made_a_turret_in_about_10_minutes/
Command block engineer // Developer // #TeamTrees