#Making teams with Gametest

1 messages · Page 1 of 1 (latest)

ornate mica
#

Guten Tag! I've seen it done before, I was wondering if anyone has an idea of what steps I should take towards this? I was hoping to use one of the ui forms for player input. For example, saves their faction name, and disables pvp for fellow members of that said group. Any tips on the direction I should take for this? All help is appreciated 🙂

still anchor
#

afaik you can not directly avoid damage done by one player to another i could be wrong if not

  1. you can try to detect if the first entity in the player's view is a team member or not, if it is? summon invisible entity in front of the player so it dont hit them

  2. you can try to use the hurt event and heal team member back on each attack made by you

thats my first 2 look at this problem thus can be improved

crude ember
#

Im pretty sure you can avoid damage without giving more hearts than there were originally, but I dont remember the steps you need to do for that because Im too tired

#

Its after 5 am and Ive made the night thru so far my brain feels like a milkshake

still anchor
#

was that all alone with scripts?

crude ember
#

Yea I think so

ornate mica
#

Yeah I’ve seen it done a few times before, of course, that being awhile ago it didn’t occur to me I should’ve asked the original creator for tips on it lol.

But if you do have a general idea surrounding the concept it would be appreciated.

still anchor
#

other than that they must be using json addon to avoid attacks because script has no such stuff yet

barren ivy
#

I have had an idea about this for a while now, but haven't acted on it yet. Bear with me for a sec.

Using damage sensor in the player file, we can do json "minecraft:damage_sensor": { "triggers": { "on_damage": { "filters": { "any_of": [ { "test": "has_tag", "subject": "self", "operator": "==", "value": "Team:1" }, { "test": "has_tag", "subject": "other", "operator": "==", "value": "Team:1" } ] } }, "deals_damage": false } } To cancel damage dealt by two players who have the tag, expanding on this as needed for the max amount of players who could join the world at one time (11 for a standard realm, more would be needed for a local world).
Using this and a player join event, we can remove all tags from player joining that start with Team:, resetting their team.
We can then check their tags (or a score) to see if any of them are identical to another player online (say, Faction:Name Here) and if so, add that player's team tag to the player who just joined.
If the above check fails, we can assign the next available team tag to the joining player, creating a new team.

Keep in mind this is an idea that I have thought about and don't know if it will work properly.

ornate mica
#

ok, that makes sense, by the sounds of it, I don't see a reason it wouldn't properly work. I'll give this a shot and see how it goes