Hey sorry, i'm trying to check if a block that i break is claim by openpac, i find a API
But can't seem to find how i can check if the block in this position is claim someone get a idea in what API i should check this mod have so much API
10 messages · Page 1 of 1 (latest)
Hey sorry, i'm trying to check if a block that i break is claim by openpac, i find a API
But can't seem to find how i can check if the block in this position is claim someone get a idea in what API i should check this mod have so much API
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
you can use the following method, which return the claimstate/null: https://github.com/thexaero/open-parties-and-claims/blob/3b2b78ae0c2a8991b198e92b0ec76ccda07f9e71/Common/src/main/java/xaero/pac/common/claims/api/IClaimsManagerAPI.java#L83`
IClaimsManagerAPI.get("overworld", event.block.pos)
I think i already try something like that but i get IClaimsManagerAPI dont have function "get"
You may have an issue with a KubeJS script and you explain it to the best of your ability yet without the actual code in question we have very little to go off of in trying to assist you.
You can find your KubeJS server log in /minecraft/logs/kubejs/server.log.
If you are on 1.18 or 1.16 it will be called server.txt.
Please send it if asked, as it contains helpful information.
Oh yes is not exactly the same way that i use. I will try thx
So i get this error :
Error in 'BlockEvents.broken': Java class "xaero.pac.common.claims.api.IClaimsManagerAPI" has no public instance field or method named "get".
// server_scripts/block_break_claim_check.js
BlockEvents.broken(event => {
let pos = event.block.pos;
let IClaimsManagerAPI = Java.loadClass('xaero.pac.common.claims.api.IClaimsManagerAPI');
let claimState = IClaimsManagerAPI.get("overworld", pos) // Utiliser directement `pos`
if (claimState != null) {
event.cancel();
event.player.tell("you can't do that!");
}
});
I find how to call it but now get a error with cancel.event
#1287233822756438057