Solved Drop inventory

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

Status
Not open for further replies.

Hobbit41

Member
Jun 15, 2017
32
0
0
Minecraft version: 1.8

Hey guys, I have event
code_language.skript:
on damage of player:
    damage cause is not fall:
        if (victim's health - damage) is less than 0.1:
            set victim's gamemode to spectator

How do I drop victim's inventory except few things? (pickaxe and sword)

Tried to loop player's inventory, but it's not working
 
Minecraft version: 1.8

Hey guys, I have event
code_language.skript:
on damage of player:
    damage cause is not fall:
        if (victim's health - damage) is less than 0.1:
            set victim's gamemode to spectator

How do I drop victim's inventory except few things? (pickaxe and sword)

Tried to loop player's inventory, but it's not working
code_language.skript:
drop all items in victim's inventory where [item input is not any pickaxe or any sword] at victim
 
code_language.skript:
drop all items in victim's inventory where [item input is not any pickaxe or any sword] at victim
well it works, thank you! UPD: no, actually it does not...

[doublepost=1503851955,1503840597][/doublepost]
code_language.skript:
drop all items in victim's inventory where [item input is not any pickaxe or any sword] at victim
UPD: code is running only up to that line. Anything that below of that line being ignored.

I mean, i have:
code_language.skript:
    if (victim's health - damage) < 0.1:
        cancel event
        add 2 gold ingot named "Подношение в золоте" with lore "&a Восхваляйте Макуту, и он услышит!|| Нажмите ПКМ, чтобы открыть магазин" to attacker
        drop all items in victim's inventory where [item input is not any pickaxe or any sword or any bow] at victim
        set the victim's gamemode to spectator

#gamemode is not changing to spectator. But if I remove or deactivate with "#" that line, code further works
and no drops at all
 
Last edited by a moderator:
you could also try removing the specified items from the drops:
code_language.skript:
remove all pickaxes from the drops
 
What console error is there?
where exatcly?
code_language.skript:
drop all items in victim's inventory where [item input is not any pickaxe or any sword] at victim
– there are no errors, just code after that line is not running and no drops

And "to avoid deathscreen or (if force respawn) to avoid loading" there are no errors, just, you know... When no force respawn gameplay is smoother )
 
Minecraft version: 1.8

Hey guys, I have event
code_language.skript:
on damage of player:
    damage cause is not fall:
        if (victim's health - damage) is less than 0.1:
            set victim's gamemode to spectator

How do I drop victim's inventory except few things? (pickaxe and sword)

Tried to loop player's inventory, but it's not working
you can clear is inventory and than set is inventory slot to what evert you want
 
found solution in:

code_language.skript:
        loop items in victim's inventory:
            add loop-value to {_inventory::*}
        loop {_inventory::*}:
            loop-value is not pickaxe or bow or sword:
                place loop-value at location of victim
 
Status
Not open for further replies.