drop items at feet when inv full

  • 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 our Wiki for downloads and any other information about Skript!

ChikensBox

Member
Sep 30, 2023
3
0
1
23
Hi im trying to make my code drop the items that are mined on the floor at players feet if inventory is full, i have skbee installed as a plugin and here is my code:
code_language.skript:
on break:
    if {build.%player%} is set:
        "%region at event-block%" does not contain "mine"
        cancel drops of items
        
    if drops of event-block is set:
        "%region at event-block%" contains "mine"
        give player drops of event-block using player's tool #or drop if inv is full
        cancel drops of items
        stop
    "%region at event-block%" contains "mine"
    set {_drops} to level of fortune on player's tool
    if level of fortune on player's tool is not set:
        set {_drops} to 1
    set {_x} to random integer between 1 and {_drops}
    cancel drops of items
    give player {_x} of event-block #or drop if inv is full

on place:
    if {build.%player%} is set:
        cancel event
        
on break:
    if {build.%player%} is set:
        "%region at event-block%" contains "world"
        "%region at event-block%" does not contain "mine"
        cancel event

command /build:
    permission: admin.build
    trigger:
        if {build.%player%} is not set:
            set {build.%player%} to true
            send "&r[&4SU&r] &eBuild mode &c&nOff"
        else:
            delete {build.%player%}
            send "&r[&4SU&r] &eBuild mode &a&nOn"

on join:
    player has permission "admin.build"
    set {build.%player%} to true
    send colored "&r[&4SU&r] &eBuild mode &c&nOff&e."
    send colored "&r[&4SU&r] &ePlease use &9&n&l/build&r&e to &a&n&lenable&r&e/&c&n&ldiasble"
 
just use condition:

Code:
loop drops of event-block using player's tool:
  if player has space for loop-value:
    give loop-value to player
  else:
    drop loop-value at player's location without velocity
 
Every 1 second:
Loop all players:
If loop-player’s inventory is full:
Loop all items in loop-players inventory:
Drop loop-value
 
No need to do all that, just use SkBee's `give or drop` effect.
https://skripthub.net/docs/?id=9276
Ok, but how do i make the drop depend on the players tool (ex if mining stone and doesnt have silktouch, than drop stone)
this is what i have, "using player's tool" part doesnt work here
Code:
on break:
    if {-build.%player%} is set: #if is set than player does not have build perms
        "%region at event-block%" contains "mine"
        set {_drops} to level of fortune on player's tool
        if level of fortune on player's tool is not set:
            set {_drops} to 1
        set {_x} to random integer between 1 and {_drops}
        cancel drops of items 
        give or drop {_x} of event-block to player
    if {-build.%player%} is not set:
        cancel drops of items
 
Last edited: