Needing Help with Sk-Reflect / CoreProtect API

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

L0v0lup

Member
Feb 19, 2017
26
2
3
27
Hi,
i am not overly experienced with Sk-Reflect and need some help with the CoreProtect API.
What i am trying to do: Check if a block is natural or not / if it has been placed by a player.
Code:
import:

    org.bukkit.Bukkit
    net.coreprotect.CoreProtect 
    net.coreprotect.CoreProtectAPI
    org.bukkit.entity.Player

on break:
    set {_t} to CoreProtectAPI.hasPlaced(player, event-location, 10000, 0)
    broadcast "%{_t}%"
    set {_s::*} to CoreProtectAPI.performLookup(600, null, null, null, null, null, 5, event-location)
    broadcast "%{_s::*}%"

Saving it in Skript-variables is because of performance reasons not an option - i want to use the logged CP-Blocks.
Thats the link to the API: https://docs.coreprotect.net/api/

[Skript 2.6-beta3, SKReflect, MC 1.17.1]
 
Last edited:
I'm not sure if the event-location output is the one that the java APIs can use, try setting the x, y and z coordinates to a variable and then use it
 
I tried now:
Code:
command /test3:
    trigger:
        set {_CP} to Bukkit.getPluginManager().getPlugin("CoreProtect")
        set {_loc} to location of player
        broadcast "%{_CP}.performLookup(100, null, null, null, null, null, 5, (location at {_loc}.getBlockX(), {_loc}.getBlockY(), {_loc}.getBlockZ() in world {_loc}.getWorld()))%"

Returning "none"
Console is throwing an error;
Code:
[02:51:50] [Server thread/WARN]: [Skript] No matching non-static method: CoreProtect#performLookup called with (100 (Long), null (Null), null (Null), null (Null), null (Null), null (Null), 5 (Long), x: -263, y: 72, z: 265 (Location))
 
Status
Not open for further replies.