Solved Last dropped item

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

Hyao

Active Member
Apr 1, 2017
73
4
8
33
Using
code_language.skript:
drop an ender pearl named "&fLoot Ball" at {_dropLoc}
how could I then target that item? To, say, add variables to it? Last dropped item doesn't work, and last spawned entity doesn't want to work either. Any suggestions would be appreciated.
 
If you're using the Bensku's fork then the last dropped item expression will work in the latest version of it (dev26 and up), if not then you will have to listen the item spawn event and do the stuff that you want.
 
If you're using the Bensku's fork then the last dropped item expression will work in the latest version of it (dev26 and up), if not then you will have to listen the item spawn event and do the stuff that you want.

How would I go about saving it? Or adding metadata/a variable to it?
Currently using:

code_language.skript:
drop an ender pearl named "&fLoot Ball" at {_clb}
                set {_lb} to last dropped item
                broadcast "%{_lb}%"
                loop {_blocksToDrop::*}:
                    add loop-value to {skT.lootBall.inventory.%{_lb}%::*}

on pick up:
    if event-item is ender pearl named "&fLoot Ball":
        cancel event
        loop {skT.lootBall.inventory.%event-entity%::*}:
            if event-player can hold loop-value:
                give loop-value to the event-player
            else:
                drop loop-value at the event-player's head

Broadcasting {_lb} just says "dropped item"

EDIT: also, thanks, updated, seems I was using dev25
 
Last edited by a moderator:
Status
Not open for further replies.