#Is possible to made combat system,like anti Interrupting

1 messages · Page 1 of 1 (latest)

dapper hawk
#

I want to made a combat system(or pvp system the main function is anti player interrupting(hit) when others 2 player is pvping

Just let the third player can't hit the player who in pvp

I think it might not be possible to make it using the scripting API, instead use entity.json

fossil jacinth
#

@dapper hawk
ik how to
dms ?

dapper hawk
dapper hawk
hearty reef
#

damage: true```
player has_tag 'inPvp' && other has_tag 'inPvp' true ||
player has_tag != 'inPvp' && ither has_tag != 'inPvp'

dapper hawk
#

I want made a ffa

#

So every 2 player can't have a same tag

hearty reef
#

Its just addition...

dapper hawk
#

Oh

#

Okey

hearty reef
#

Hmm, dunno how ur tagging works

#

Im not on my laptop atm

dapper hawk
#

1 combat tag just can 2 player

#

If the damaingEntity not has combat tag but hit ENTITY has combat tag then the damaingEntity will not be add tag

hearty reef
#

How are the tags added?
Remove the other tags every time u add tag

dapper hawk
#

Remove the combat tag

#

If combat_1 tag alr have player pvping then will use combat_2 tag (not sure is working or not)

#

I think I need 4 player to test it

hearty reef
#

U might have to record the 2 players who has such tag

hearty reef
#

Refer to it to know when the player shouldn't have the tag

#

Like when they leave and rejoin

dapper hawk
#

I'm just made a tags counter

#

To count the player who have the tag

dapper hawk
hearty reef
#

Removing tag when player leaves errors, iirc

dapper hawk
hearty reef
#

Uhm, in beforevent playerLeave, there's privilege errors

dapper hawk
#

I not do left event yet but I alr have addon

#

But my idea have some difference

#

I'm not remove tag when player left

#

Rather is rejoin

hearty reef
#

The player isn't valid that's why its not possible in playerLeave
however, it's removable in playerSpawn to remove the past "pvp leave" records

dapper hawk
#

When player rejoined then remove all combat tag

#

Btw

#
const tags = ['combat_1', 'combat_2', 'combat_3', 'combat_4'];

function countTags(tags) {
    const counts = {};
    for (const tag of tags) {
        counts[tag] = 0;
    }
    for (const player of world.getPlayers()) {
        for (const tag of tags) {
            if (player.hasTag(tag)) counts[tag]++;
        }
    }
    return counts;
}

Did I correctly count the player who has tag ? @hearty reef

hearty reef
#

Yes, but that's for online players only

dapper hawk
#

The offline player is not influence

dapper hawk
hearty reef
dapper hawk
#

Doesn't using random

#

Just like queue

#

Combat1 full then combat2 and so on

hearty reef
#

Hmm, assuming the tags gets removed from everyone, followed by adding to the queued players,
is there still a function needed for uninterruptions?

hearty reef
#

To ensure the tag is only added to the current participants

dapper hawk
#

Yea

#

HitEntity will get the tag same as damagingEntity

hearty reef
#

Ok, so how is 3rd player possible to interfere with the 2 players in pvp?

dapper hawk
#

He is just get notice and immune damage

hearty reef
#

Hmm, did u test the fire_aspect sword?

dapper hawk
#

But this is be writen in json

#

Can't deal damage

hearty reef
#

Fire_aspect works different

#

Its like potions

dapper hawk
#

What

#

How

#

I will test it later

hearty reef
#

Cant sword dmg, but inflicts burn

dapper hawk
#

Burn will deal damage?

hearty reef
#

The burning dmg, yes

dapper hawk
#

Oh that bad

hearty reef
#

Cus the "other" source is undefined

#

Welp, that's just the pvp with enchanted equupments/pots

dapper hawk
#

Has another way to solve?

hearty reef
#

Itd be a janky way, like purifying (remove dmging effects) every nonpvp participant hit

#

The current way i know to remove the burn is player.extinguishFire()