how to add drops to a variable

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

Mich7272

Member
Apr 12, 2019
49
0
0
23
Hi I wanna know how to add drops to a local variable like this
Code:
on mine:
    add drops to {_drops::*}
    clear drops
    loop {_drops::*}:
        add loop-value to player's inventory
        stop
on break:
    add drops to {_drops::*}
    clear drops
    loop {_drops::*}:
        add loop-value to player's inventory
        stop
this is not working the drops are not savin in the {_drops::*} and I have no console errors
 
You cant get the drops from the event
Screen Shot 2019-08-17 at 3.49.55 PM.png
 
OK and there is a way to do that or an addon?
The reason it doesnt work this way, is because Bukkit's break event, doesn't have a method for getting the drops.

There is a drop event, but it may be inconsistent from what I have read.

Here is a short example of how I tested it with skript-mirror (which is required for this)
code_language.skript:
import:
    org.bukkit.event.block.BlockDropItemEvent

on BlockDropItemEvent:
    set {_p} to event.getPlayer()
    loop ...event.getItems():
        add loop-value.getItemStack() to inventory of {_p}
    event.getItems().clear()
 
The reason it doesnt work this way, is because Bukkit's break event, doesn't have a method for getting the drops.

There is a drop event, but it may be inconsistent from what I have read.

Here is a short example of how I tested it with skript-mirror (which is required for this)
code_language.skript:
import:
    org.bukkit.event.block.BlockDropItemEvent

on BlockDropItemEvent:
    set {_p} to event.getPlayer()
    loop ...event.getItems():
        add loop-value.getItemStack() to inventory of {_p}
    event.getItems().clear()
how do I get the monsters drops ? or people drops?
 
Status
Not open for further replies.