#Detect Origin
44 messages · Page 1 of 1 (latest)
??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.
How would you like me to be more specific
What is origin
Origin mod
You want to check the origin of a player or what
Then idk
So if they select human
Run a gamestage to allow recipes
If you know that as well would help if that is possible
Because i could just check if they are that and allow or deny
That requires you to know some java
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
You can get a capability instance of origin by loading this class https://github.com/EdwinMindcraft/origins-architectury/blob/1.19.x/forge/src/main/java/io/github/edwinmindcraft/origins/api/capabilities/IOriginContainer.java
And call get
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)```
meh i dont have the pack/mod loaded atm 😛
Keep in mind that returns a lazy optional so you might need to check if it exists first
I'm mostly relaying on yall here due to I'm not fully experienced in java
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
I get this checks but how do I specify the origin
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
are the recipes hardcoded for each origin? maybe you should find a easier way by using datapack
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)
what would i type to check hasorigin (for specific)
no im using gamestages / recipe stages/ itemstages
working really slowly as i want to make sure i get everything right
do you mean what would you need to check if an entity has an origin?
That code snippet has an if statement if it’s not present