#player.json

1 messages · Page 1 of 1 (latest)

half ferry
#

.

steel wagon
#

skill issue ngl

#

Jk send the entity file in this channel and you'll probably get helped by a few people

half ferry
steel wagon
#

People post questions in these channels all the time, this thread will be berried in about a day if no-one talks in it. If your worry is an NDA, you shouldn't be showing anyone and should instead contact the lead dev at your studio. if your worry is that your code is terribe, i've seen worse.

steel wagon
#

I'm assuming that it is just logic errors - I do not know as I don't know exactly how the tags are controlled. If it is based off of the highest ranking piece of armour that they are wearing, it is flawed as they will not have bothg chainmain and leather tags.
Also, why are there 2 very similar damage sensors?
I would recommend breaking it down into individual tests and make sure that each one works instead of adding them all and wondering which one is broken.

half ferry
steel wagon
#

My bad I meant why do you have 2 that are similar but only one runs an event

half ferry
#

i only need an event for who cannot hit who

#

i suck at explaining lmao

steel wagon
#

Logic is definitely the issue then, in your example, this makes no sense. If based off of highest ranking material, a player will not have iron, diamond, and netherite tags. Use

all_of{ 
    {
        self:leather
    },
    any_of {
        other:iron, diamond,netherite
    }
}
half ferry
#

oohh

#

i knew it was something with logic but i never knew how to fix it

#

thank you so much, i'll try this tomorrow, as for now I'm heading to sleep..

steel wagon
#

yeah, np

half ferry
# steel wagon yeah, np
  },
                      {
                        "any_of": [
                          all_of{ 
                            {
                                self:leather
                            },
                            any_of {
                                other:iron, diamond,netherite
                            }
                          },
                          {```
#

uhm this might be dumb but im struggling with it lol

half ferry
# steel wagon yeah, np
                      {
                        "any_of": [
                          all_of{ 
                            {
                              "test": "has_tag",
                              "subject": "self",
                              "value": "leather",
                            },
                            any_of {
                              "test": "has_tag",
                                "subject": "other",
                                "value": "iron, diamond,netherite",
                            },
                          ]
                          }```
#

lol

#

i keep getting errora these brackets and commas r defo not correct if its this

half ferry
#

hello..

steel wagon
#

Mb read this on my phone and meant to reply once I had turned on my pc but then I couldn't remember what I was supposed to reply to lol

#

anyway, this is incorrect json, the text I sent was simply logic and not actual code

steel wagon
#
                            "all_of": [
                                {
                                    "test": "has_tag",
                                    "value": "leather",
                                    "subject": "self"
                                },
                                {
                                    "any_of": [
                                        {
                                            "test": "has_tag",
                                            "value": "iron",
                                            "subject": "other"
                                        },
                                        {
                                            "test": "has_tag",
                                            "value": "diamond",
                                            "subject": "other"
                                        },
                                        {
                                            "test": "has_tag",
                                            "value": "netherite",
                                            "subject": "other"
                                        }
                                    ]
                                }
                            ]
half ferry
#

it's not working still..

steel wagon
#

Who are leather supposed to be able to attack?

half ferry
#

leather and chainmail

steel wagon
#

ok, this says that leather cannot hard leather or chainmail

half ferry
#

chainmail can attack leather, chainmail, and iron

steel wagon
#

The damage sensor is removing damage on the condition that they both have leather/they have leather and enemy has chain

half ferry
#

oh

steel wagon
#

You could also use none_of instead of any_of in the enemy test instead of listing everyone who cannot harm them

half ferry
#

wait excuse me so which one do i remove the first or second lol

steel wagon
#

e.g.,

{
    "all_of": [
        {
            "test": "has_tag",
            "value": "leather",
            "subject": "self"
        },
        {
            "none_of": [
                {
                    "test": "has_tag",
                    "value": "leather",
                    "subject": "other"
                },
                {
                    "test": "has_tag",
                    "value": "chainmail",
                    "subject": "other"
                }
            ]
        }
    ]
},
half ferry
#

who cannot hit who, the second?

#

ohh

half ferry
#

its not running..

steel wagon
#

Does the event work?

half ferry
#

its supposed to

steel wagon
#

check if it does

half ferry
#

ight ill apply this new code rq

#

im having trouble with the brackets lmao

#

what am i doing wronggg

steel wagon
#

When you run the event, does it work?

half ferry
#

these brackets have been messing with me for the past 10 mins lmao

half ferry
steel wagon
#

Just run /event entity @s event_name?

#

Check with json lint

half ferry
half ferry
#

because this event is supposed to only run for that list, if you cannot harm them it runs the event which tells you that you cant hit them

half ferry
steel wagon
#

send the event

half ferry
half ferry
# steel wagon send the event
 "rain:invalid_hit": {
        "run_command": {
          "command": [
            "title @s actionbar {\"rawtext\":[{\"text\":\"§cYou can't hit the other player! The gear difference is too high!\"}]}",
            "playsound @s note.bass"
          ]
        }
      },```
steel wagon
#

What format version does this file use?

half ferry
#

1.18.20

steel wagon
#

Do you have hcf enabled?

#

is experimental set to true?

half ferry
#

mhm

#

idk what hcf is but I have almost everything enabled

#

everything script api related and so on

steel wagon
#

Make sure that your manifest reflects the change

half ferry
#

oh my manifest is on the newest version

steel wagon
#

good

half ferry
#

the player.json is 1.18.20 lol

steel wagon
#

set it to 1.19.50 minimum

half ferry
#

would i need to change anything to do that or?

steel wagon
#

no

half ferry
#

just change the version number? sounds easy

steel wagon
#

it might be 1.16.100 actually? idr either way 1.19.50 might help

steel wagon
half ferry
#

ight its 1.19.5 now

#

well heres my current damage_sensor component/s

#

as usual im having one error with closing a bracket lol

steel wagon
#
#

What IDE do you use?

half ferry
#

sorry what

#

oh

steel wagon
#

What do you write your code onto

half ferry
#

vs code

steel wagon
#

Do you not have the json extension?

half ferry
#

dont think so

#

what's its purpose may I ask?

steel wagon
#

makes sense, you should get one, it'll flag it when your json code is wrong

#

I use bridge which also comes with an autoformatter

#

file system isnt great though

half ferry
#

installing it right now

#

ight idk how to use it but I got it

steel wagon
#

nice

#

bridge or the json extension?

half ferry
half ferry
steel wagon
half ferry
#

hopefully it works now

#

as it should

steel wagon
#

Idk if it will, I never checked, just corrected the json lol

half ferry
#

if it doesnt its prob still a problem from the logic itself

#

oh my

#

i think the player.json is broken lol

#

when i hit the player he starts floating

#

and the ground is like ice when u move on it

#

no gravity

steel wagon
#

You're missing all of the other player components

#

for example: physics

half ferry
#

i got everything

#

could it be bc of the version?

steel wagon
#

Invalid Json

half ferry
#

wait what

steel wagon
#

You see how with component groups closed, there is no components object... that's not supposed to happen

half ferry
#

oh i just realized..

#

but what does this have to do with the whole code

#

well ig fair enough

steel wagon
steel wagon
half ferry
#

i dont get it like it makes sense

#

if player has tag and the target has any of those he can attack

#

for the other if player has tag and the target has any of those he can't attack

#

oh there we go the event now workn't

#

lol

steel wagon
steel wagon
half ferry
#

yeah yeah i fixed it mb

half ferry
#

testing it

half ferry
# steel wagon

btw quick question shouldnt the first armor system deals_damage component be set to true since its who can hit who?

half ferry
steel wagon
#

you probably removed your components again

half ferry
half ferry
#

event works tho

#

when i hit someone with the first system it runs the event on them lol

#

this feels cursed

#

oh my my brain

half ferry
steel wagon
#

then swap the events

half ferry
#

First system doesn't work

#

second does

half ferry
steel wagon
#

yeah

half ferry
# steel wagon yeah

well yeah i guess everything is supposed to work now but the second system lol

#

both systems dont work 😭

half ferry
#

isnt the first system useless

#

like i dont have to specify who hits who, i just specify who cant hit who

#

but i still need it lol

steel wagon
#

yeah, you just have to specify who cannot hit whom

half ferry
#

wait even the "safe" tag broke though it doesnt have to do anything with this

half ferry
#

@steel wagon hey apologies for disturbing, but i fixed everything but the event :/

#

everything perfectly works fine now but the event doesnt run

#

it runs through commands

#

but in the json it doesn't

half ferry
steel wagon
#

when you run the event using commands, does it work?

half ferry
#

but not in the json apparently

#

thats the only thing left i fixed everything else

#

so...

half ferry
steel wagon
half ferry
#

target: "other" or "self"?

half ferry
steel wagon
steel wagon
half ferry
#

when you hit someone and you can hit him it runs the event, i tried putting it in the other system but for some reason that breaks everything

#
        "event": "rain:invalid_hit",
              "target": "other",
              "deals_damage": false```
#

weird that this only works on the first system despite it being all the way down

half ferry
# steel wagon it's target not subject

would it be because it should be self and not other, or wait is it bc the second event is on_damage but it cancels the damage so it never damages but the first damages so it runs