#Detect Origin

44 messages · Page 1 of 1 (latest)

keen summitBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

pine hinge
#

??helpyou

golden lavaBOT
# pine hinge ??helpyou

╰( ͡° ͜ʖ ͡° )つ──☆:・゚˜”°•.˜”°• Many Help •°”˜.•°”˜*
Please provide a description of your issue with as much detail as possible. If you have an issue with a script provide the script. Explain what you can see happening and what you expect to happen. Be specific!

Tell us what is happening, we already know it "doesn't work".
Avoid using words like "it", tell us exactly what "it" is.
Don't assume anyone knows what you are talking about, be specific.

Provide screenshots or video if possible.
Provide the log.

normal panther
#

How would you like me to be more specific

dusk gust
#

What is origin

pine hinge
#

I don't know what you mean by "origin"

#

provide more context

normal panther
#

Origin mod

dusk gust
#

You want to check the origin of a player or what

normal panther
#

No

#

When they select an origin

dusk gust
#

Then idk

normal panther
#

So if they select human
Run a gamestage to allow recipes

normal panther
#

Because i could just check if they are that and allow or deny

dusk gust
#

That requires you to know some java

normal panther
#

So it be better if I hired someone then

#

I'm trying to disable recipe/usage of certain mods with being certain origins

To make a bigger diversity in trade and gameplay

dusk gust
#

And call get

broken saddle
#

would that be lie so Pruno? i'm not that good at loading classes

//put this at the very start of ur script

const origins = Java.loadClass(`io.github.edwinmindcraft.origins.api.capabilities.IOriginContainer`)


// use this inside an event

let checkOrigin = origins.get(entity)```
dusk gust
#

I guess yes, need to test out yourself

#

Never played origins before

broken saddle
#

meh i dont have the pack/mod loaded atm 😛

normal panther
#

ill test it out in abit

#

or when i start the restriction stuff

languid zodiac
normal panther
languid zodiac
#

You can use this method:
isPresent to check if it exists

#
//put this at the very start of ur script

const origins = Java.loadClass(`io.github.edwinmindcraft.origins.api.capabilities.IOriginContainer`)


// use this inside an event

let checkOrigin = origins.get(entity).orElse(null);
// return from whatever event you are in if the origin is not present on the entity
if (!checkOrigin) return;
// do something with origin
normal panther
#

Ohhh that's to activate something when they get an origin thays great not I just need to check what origin they have

#

I see hasorigin true or false in there

cunning cargo
#

are the recipes hardcoded for each origin? maybe you should find a easier way by using datapack

ashen finch
#

I just saw that the origin that a player has can be access with /data get entity @s ForgeCaps."origins:origins".Origins."origins:origin"

#

mabye you could make a datapack in order to detect the origin, then change the player's stage with /kubejs stages add @s (your stage)

normal panther
normal panther
#

working really slowly as i want to make sure i get everything right

languid zodiac
normal panther
#

yeah im trying to get it to run like if they select Dwarf
run these actions

#

or set this stages