#player.json
1 messages · Page 1 of 1 (latest)
skill issue ngl
Jk send the entity file in this channel and you'll probably get helped by a few people
could I dm you it instead, I wouldn't prefer making it public lol..
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.
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.
it is indeed based off the highest ranking, leather, chain, iron, diamond, and netherite. also it makes more sense how they should have both tags, but my i wanted it to make it like if the person has any of those tags, isn't that possible? I suck and json. also wdym by 2 damage_sensors, do u mean 2 diff filters? one for who can hit who and the other for who cannot hit who..
My bad I meant why do you have 2 that are similar but only one runs an event
the who can hit who is the first one, i dont need an event for that
i only need an event for who cannot hit who
i suck at explaining lmao
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
}
}
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..
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
{
"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
hello..
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
this isn't code, just logic of how the code should look
"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"
}
]
}
]
hey apologies for bothering but
it's not working still..
Who are leather supposed to be able to attack?
leather and chainmail
ok, this says that leather cannot hard leather or chainmail
chainmail can attack leather, chainmail, and iron
The damage sensor is removing damage on the condition that they both have leather/they have leather and enemy has chain
oh
You could also use none_of instead of any_of in the enemy test instead of listing everyone who cannot harm them
wait excuse me so which one do i remove the first or second lol
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"
}
]
}
]
},
what about the event in the end?
its not running..
Does the event work?
its supposed to
check if it does
ight ill apply this new code rq
im having trouble with the brackets lmao
what am i doing wronggg
When you run the event, does it work?
these brackets have been messing with me for the past 10 mins lmao
i cant test bc of the closing brackets having errors ðŸ˜
:
also i need to list
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
send the event
alr
"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"
]
}
},```
What format version does this file use?
1.18.20
mhm
idk what hcf is but I have almost everything enabled
everything script api related and so on
1.19.50 is the minimum format version for run_command
Make sure that your manifest reflects the change
uhm it does work on my anti afk tho
oh my manifest is on the newest version
good
the player.json is 1.18.20 lol
set it to 1.19.50 minimum
would i need to change anything to do that or?
no
just change the version number? sounds easy
it might be 1.16.100 actually? idr either way 1.19.50 might help
yeah
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
JSONLint is the free online validator and json formatter tool for JSON, a lightweight data-interchange format. You can format json, validate json, with a quick and easy copy+paste.
What IDE do you use?
What do you write your code onto
vs code
Do you not have the json extension?
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
ill try this now..
json extension
alr
Idk if it will, I never checked, just corrected the json lol
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
Invalid Json
wait what
You see how with component groups closed, there is no components object... that's not supposed to happen
oh i just realized..
but what does this have to do with the whole code
well ig fair enough
It means that the game sees the entity as having no components
well despite that, it still doesnt work lol
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
yeah yeah i fixed it mb
btw quick question shouldnt the first armor system deals_damage component be set to true since its who can hit who?
oh yeah also player.json broken again
you probably removed your components again
uhm so
the second one works
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
this system is like fully inverted now
then swap the events
i switched the "self" to "other" nothing changed, did u mean like put it in the first system?
yeah
well yeah i guess everything is supposed to work now but the second system lol
both systems dont work ðŸ˜
wait uh
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
yeah, you just have to specify who cannot hit whom
doesn't work
wait even the "safe" tag broke though it doesnt have to do anything with this
@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
1 quick question, i fixed everything but either of the systems stop working whenever i add this json "event": "rain:invalid_hit", "subject": "other", with the deals_damage
when you run the event using commands, does it work?
yes
but not in the json apparently
thats the only thing left i fixed everything else
so...
it's target not subject
oh
I'd recommend that you use bridge https://bridge-core.app/guide/download/index.html
target: "other" or "self"?
ill get into it though I know nothing about it
It's an IDE designed for bedrock devlopment, it'll help you
other
oh hey mb i just tested it but it doesnt fully work
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
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