How to loop dropped items inside of player's plot? [PlotSquared v7]

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

HeliumBoi

Active Member
Sep 15, 2023
62
6
8
So i wanna make something called "Gen Collector" but im facing some issues, i see that skript doesnt have direc support for PlotSquared 7 and i was thinking if there is any addons.
So for this thing "GenCollector" to work i need to loop every single items inside of player's plot so it gets collected by the gen collector and will disappear from ground.
 
you could always add a wait after the gen drops the item like ... when gen drops wait 5 seconds remove drop and add to gen collector so u dont have to loop
 
you could always add a wait after the gen drops the item like ... when gen drops wait 5 seconds remove drop and add to gen collector so u dont have to loop
i dont have gens its not for gen server. its a natural minecraft server like you plant crop for example cactus, you wait for it to grow (RTS-50, aka random tick speed) and it drops cactus, i want that cactus to be inside of a gen colllector(virtually, like in numbers not inventory type). another question, how do i check player's plot'd dropped items??
 
Last edited:
You could create a world guard region at the plot when it is created and then do something like:
Code:
on mine:
    "%region at event-block%" contains "example region":
        clear drops
        #rest of code

As you said, Skript doesn't have direct support for PlotSquared so I don't believe there is a way to loop based on the plot. This is the most effective way I can think of and it still isn't very good.

Alternatively, you could set the front up left and back down right corners of each plot, loop entities in between them, and see if loop-entity contains the dropped item, however, this would mean looping every single plot when any block is mined. In the code's current state, it'd be best to specify specific blocks (such as cactus) because right now any block mined in the region just gets deleted, but you seem to have everything but the looping packed down.
Code untested unless stated otherwise.
 
You could create a world guard region at the plot when it is created and then do something like:
Code:
on mine:
    "%region at event-block%" contains "example region":
        clear drops
        #rest of code

As you said, Skript doesn't have direct support for PlotSquared so I don't believe there is a way to loop based on the plot. This is the most effective way I can think of and it still isn't very good.

Alternatively, you could set the front up left and back down right corners of each plot, loop entities in between them, and see if loop-entity contains the dropped item, however, this would mean looping every single plot when any block is mined. In the code's current state, it'd be best to specify specific blocks (such as cactus) because right now any block mined in the region just gets deleted, but you seem to have everything but the looping packed down.
Code untested unless stated otherwise.
Yea i was thinking like this. on drop (here is the real deal) if the player is on his own plot and if player has placed a gen collector, set a variable to the amount of the drop, delete the drop and add the set variable value to the variable of the gen collector(its gonna be virtual). that was how i was thinking it.
The gen collector works as collecting only 1 specific item the player sets it while its opening the GUI of the specific Gen Collector so that it collects that item if in any case it will be dropped in player's plot.

The gui is 3 rows and on 13th slot there is a set item by player. you can change it by clicking on any item in your inventory. it shows how many items it collected so far (in variable placeholders), and you can get the items physically by clicking on it. if clicked with shift and click it will give 64 of that item to your inventory and removes that value from its variable value.

simple as that.