Skript-Reflect x PlotSquaredAPI

  • 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 community!

    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!

1740942662851.png
1740942681002.png
 
add this to your imports:
java.util.Arrays

Then copy paste:

set {_list} to Arrays.asList({_Plot}.getConnectedPlots().toArray())

send "list object: %{_list}%" to players # delete this in future...
send "list size: %{_list}.length%" to players # delete this in future...
send "index 0: %{_list}[0]%" to players # delete this in future...
 
Code:
function MoonMC_PlotAPI_RandxWand(p: player, mat: material, type: text):
    if {_p} is set:
        set {_Player} to {_p}
        set {_PlotAPI} to new PlotAPI()
        set {_PlotPlayer} to PlotPlayer.from({_Player})
        set {_Plot} to {_PlotPlayer}.getCurrentPlot()
        set {_newPlot} to new Plot()
        set {_Material} to {_mat}
        set {_Pattern} to ConfigurationUtil.BLOCK_BUCKET.parseString({_Material}.toString()).toPattern()
   
        if {_Plot}.isOwner({_Player}.getUniqueId()):
            send "ja" to {_p}
        else:
            send "nein" to {_p}
   
   
        if {_Plot}.getConnectedPlots().size() > 1:
            set {_list} to Arrays.asList({_Plot}.getConnectedPlots().toArray())

            send "list object: %{_list}%" to players # delete this in future...
            send "list size: %{_list}.length%" to players # delete this in future...
            send "index 0: %{_list}[0]%" to players # delete this in future...
           
            set {_i} to 0
            while {_i} < {_list}.size():

                add {_list}.get({_i}) to {_skriptList::*}
                send "%{_skriptList::*}%" to {_p}
                add 1 to {_i}
               
            #set {_ConnectedPlots} to {_Plot}.getConnectedPlots()
            #{_ConnectedPlots}.getPlotModificationManager().setComponent("border", {_Pattern}, null, null)
           
        else:
            {_Plot}.getPlotModificationManager().setComponent("border", {_Pattern}, null, null)
1740943245432.png
1740943279131.png
 
Code:
function MoonMC_PlotAPI_RandxWand(p: player, mat: material, type: text):
    if {_p} is set:
        set {_Player} to {_p}
        set {_PlotAPI} to new PlotAPI()
        set {_PlotPlayer} to PlotPlayer.from({_Player})
        set {_Plot} to {_PlotPlayer}.getCurrentPlot()
        set {_newPlot} to new Plot()
        set {_Material} to {_mat}
        set {_Pattern} to ConfigurationUtil.BLOCK_BUCKET.parseString({_Material}.toString()).toPattern()
  
        if {_Plot}.isOwner({_Player}.getUniqueId()):
            send "ja" to {_p}
        else:
            send "nein" to {_p}
  
  
        if {_Plot}.getConnectedPlots().size() > 1:
            set {_list} to Arrays.asList({_Plot}.getConnectedPlots().toArray())

            send "list object: %{_list}%" to players # delete this in future...
            send "list size: %{_list}.length%" to players # delete this in future...
            send "index 0: %{_list}[0]%" to players # delete this in future...
          
            set {_i} to 0
            while {_i} < {_list}.size():

                add {_list}.get({_i}) to {_skriptList::*}
                send "%{_skriptList::*}%" to {_p}
                add 1 to {_i}
              
            #set {_ConnectedPlots} to {_Plot}.getConnectedPlots()
            #{_ConnectedPlots}.getPlotModificationManager().setComponent("border", {_Pattern}, null, null)
          
        else:
            {_Plot}.getPlotModificationManager().setComponent("border", {_Pattern}, null, null)
View attachment 9190View attachment 9191
It workedddd!!!

You can use {_skriptList::*} as you wish. Your plots are stored in it.
 
bro but i cant change the border with the plot id hahah
i has do be parsed as plot cause its not "CB;1;0.getPlotModificationManager().setComponent("border", {_Pattern}, null, null)"

it wont work
 
bro but i cant change the border with the plot id hahah
i has do be parsed as plot cause its not "CB;1;0.getPlotModificationManager().setComponent("border", {_Pattern}, null, null)"

it wont work
Can you send me the class of it?

Use this:

send {_skriptList::1}.getClass() to players

Place it after the while loop.