Solved I Need help testing if players inventory is 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 skUnity Downloads for downloads and any other information about Skript!

Neelix_bear

Active Member
Aug 11, 2023
215
7
18
As The Title Says I need help seeing if players inventory is full right now i have a script like this
Code:
on mine:
  if gamemode of player is survival:
    if player is in world "Gens":
      set {_fortune} to the level of fortune on player's tool
      set {_no_bonus_chance} to 0 / ({_fortune} + 1)
      set {_rand_pick} to a random number between 1 and 1
      set {_num_drops} to 1
      if {_rand_pick} is greater than {_no_bonus_chance}:
        set {_num_drops} to a random integer between ({_fortune} + 1) and ({_fortune} + 1)
      clear drops
      if event-block is oak log:
        give {_num_drops} of oak log to player
      else if event-block is stone:
        give {_num_drops} of cobblestone to player
      else if event-block is coal ore:
        give {_num_drops} of coal to player
      else if event-block is iron ore:
        give {_num_drops} of iron ingot to player
      else if event-block is gold ore:
        give {_num_drops} of gold ingot to player
      else if event-block is diamond ore:
        give {_num_drops} of diamond to player
      else if event-block is emerald ore:
        give {_num_drops} of emerald to player
      else if event-block is nether quartz ore:
        give {_num_drops} of quartz to player
      else if event-block is sculk:
        give {_num_drops} of sculk to player
      else if event-block is ancient debris:
        give {_num_drops} of netherite ingot to player
      else if event-block is amethyst block:
        give {_num_drops} of amethyst block to player
      else if event-block is lapis ore:
        give {_num_drops} of lapis lazuli to player
      else if event-block is lapis block:
        give {_num_drops} of lapis block to player
      else if event-block is emerald block:
        give {_num_drops} of emerald block to player
      else if event-block is netherite block:
        give {_num_drops} of netherite block to player
      else if event-block is copper block:
        give {_num_drops} of copper block to player
      else if event-block is diamond block:
        give {_num_drops} of diamond block to player
      else if event-block is gold block:
        give {_num_drops} of gold block to player
      else if event-block is iron block:
        give {_num_drops} of iron block to player
i want it to test if the players inventory is full and if it is send "&4&lYour Inventory is full!!!" to them!
 
if player has air:

I'd imagine this would work
ok im testing it now, ok so its
Code:
on mine:
  if gamemode of player is survival:
    if player is in world "world":
      set {_fortune} to the level of fortune on player's tool
      set {_no_bonus_chance} to 0 / ({_fortune} + 1)
      set {_rand_pick} to a random number between 1 and 1
      set {_num_drops} to 1
      if {_rand_pick} is greater than {_no_bonus_chance}:
        set {_num_drops} to a random integer between ({_fortune} + 1) and ({_fortune} + 1)
      clear drops
      if event-block is oak log:
        give {_num_drops} of oak log to player
      else if event-block is stone:
        give {_num_drops} of cobblestone to player
      else if event-block is coal ore:
        give {_num_drops} of coal to player
      else if event-block is iron ore:
        give {_num_drops} of iron ingot to player
      else if event-block is gold ore:
        give {_num_drops} of gold ingot to player
      else if event-block is diamond ore:
        give {_num_drops} of diamond to player
      else if event-block is emerald ore:
        give {_num_drops} of emerald to player
      else if event-block is nether quartz ore:
        give {_num_drops} of quartz to player
      else if event-block is sculk:
        give {_num_drops} of sculk to player
      else if event-block is ancient debris:
        give {_num_drops} of netherite ingot to player
      else if event-block is amethyst block:
        give {_num_drops} of amethyst block to player
      else if event-block is lapis ore:
        give {_num_drops} of lapis lazuli to player
      else if event-block is lapis block:
        give {_num_drops} of lapis block to player
      else if event-block is emerald block:
        give {_num_drops} of emerald block to player
      else if event-block is netherite block:
        give {_num_drops} of netherite block to player
      else if event-block is copper block:
        give {_num_drops} of copper block to player
      else if event-block is diamond block:
        give {_num_drops} of diamond block to player
      else if event-block is gold block:
        give {_num_drops} of gold block to player
      else if event-block is iron block:
        give {_num_drops} of iron block to player
      else if event-block is dried kelp block:
        give {_num_drops} of dried kelp block to player
      else if event-block is prismarine bricks:
        give {_num_drops} of prismarine bricks to player
      else if event-block is sponge:
        give {_num_drops} of sponge to player
      else if event-block is sea lantern:
        give {_num_drops} of sea lantern to player
      else if event-block is conduit:
        give {_num_drops} of conduit to player
    if player has air:
      send "" to player
    else:
      send "&4&lYour Inventory Is Full" to player
hopfully it works, ok it doesnt work
edit: ok so it just spams the chat with your inventory is full when it isnt
 
Last edited:
@Neelix_bear Oh you misunderstood

I meant as in use "if player does not have air" = If the inventory IS full;
"if player has air" = If the inventory IS NOT full
so uh i tried this and it still spams chat when inv isnt full @Maxgamer9473
Code:
on mine:
  if gamemode of player is survival:
    if player is in world "Gens":
      set {_fortune} to the level of fortune on player's tool
      set {_no_bonus_chance} to 0 / ({_fortune} + 1)
      set {_rand_pick} to a random number between 1 and 1
      set {_num_drops} to 1
      if {_rand_pick} is greater than {_no_bonus_chance}:
        set {_num_drops} to a random integer between ({_fortune} + 1) and ({_fortune} + 1)
      clear drops
      if event-block is oak log:
        give {_num_drops} of oak log to player
      else if event-block is stone:
        give {_num_drops} of cobblestone to player
      else if event-block is coal ore:
        give {_num_drops} of coal to player
      else if event-block is iron ore:
        give {_num_drops} of iron ingot to player
      else if event-block is gold ore:
        give {_num_drops} of gold ingot to player
      else if event-block is diamond ore:
        give {_num_drops} of diamond to player
      else if event-block is emerald ore:
        give {_num_drops} of emerald to player
      else if event-block is nether quartz ore:
        give {_num_drops} of quartz to player
      else if event-block is sculk:
        give {_num_drops} of sculk to player
      else if event-block is ancient debris:
        give {_num_drops} of netherite ingot to player
      else if event-block is amethyst block:
        give {_num_drops} of amethyst block to player
      else if event-block is lapis ore:
        give {_num_drops} of lapis lazuli to player
      else if event-block is lapis block:
        give {_num_drops} of lapis block to player
      else if event-block is emerald block:
        give {_num_drops} of emerald block to player
      else if event-block is netherite block:
        give {_num_drops} of netherite block to player
      else if event-block is copper block:
        give {_num_drops} of copper block to player
      else if event-block is diamond block:
        give {_num_drops} of diamond block to player
      else if event-block is gold block:
        give {_num_drops} of gold block to player
      else if event-block is iron block:
        give {_num_drops} of iron block to player
      else if event-block is dried kelp block:
        give {_num_drops} of dried kelp block to player
      else if event-block is prismarine bricks:
        give {_num_drops} of prismarine bricks to player
      else if event-block is sponge:
        give {_num_drops} of sponge to player
      else if event-block is sea lantern:
        give {_num_drops} of sea lantern to player
      else if event-block is conduit:
        give {_num_drops} of conduit to player
      if player does not have air:
        send "&4&lYour Inventory Is Full!!!" to player
thats my script and it still spames chat soo help!
 
Code:
on script load:
    if {genblocks::*} is not set:
        set {genblocks::*} to oak log, stone, coal ore, iron ore, diamond ore, emerald ore, nether quartz ore, sculk, ancient debris, amethyst block, lapis ore, lapis block, emerald block, netherite block, copper block, diamond block, gold block, iron block, dried kelp block, prismarine bricks, sponge, sea lantern and conduit
        broadcast "&a&lDone! &7Now remove this section from your .sk file. (This whole on script load)"
        broadcast "&6This is meant to run one-time only."
        
on mine:
    if gamemode of player is survival:
        if event-world is "Gens":
            clear drops
            set {_fortune} to the level of fortune on player's tool
            set {_no_bonus_chance} to 0 / ({_fortune} + 1)
            set {_rand_pick} to a random number between 1 and 1
            set {_amount} to 1
            if {_rand_pick} is greater than {_no_bonus_chance}:
                if {_fortune} is set:
                    set {_amount} to a random number between ({_fortune} + 1) and ({_fortune} + 1)
            if {genblocks::*} contains type of event-block:
                if player has enough space for 1 barrier:
                    set {_i} to "%type of event-block%" parsed as item
                    give {_amount} of {_i} to player
                else:
                    send "&cYour inventory seems to be full!" to player

command /modifygenblocks [<text>]:
    permission: server.modifygenblocks
    permission message: &cYou do not have permission to execute this command.
    trigger:
        if target block of player is set:
            if target block of player is not air:
                if {genblocks::*} does not contain target block of player:
                    add target block of player to {genblocks::*}
                    send "&aAdded this block to the list!" to player
                else:
                    remove target block of player from {genblocks::*}
                    send "&cRemoved this block from the list!" to player
            else:
                send "&cHmm... I agree, it's a nice view. Just not what I'm looking for however." to player
        else:
            send "&cLook at a block to modify the genblocks list." to player
Hi! I've made some additional changes next to fixing the inventory full problem. I hope this makes it easier for you! :emoji_slight_smile:
 
Code:
on script load:
    if {genblocks::*} is not set:
        set {genblocks::*} to oak log, stone, coal ore, iron ore, diamond ore, emerald ore, nether quartz ore, sculk, ancient debris, amethyst block, lapis ore, lapis block, emerald block, netherite block, copper block, diamond block, gold block, iron block, dried kelp block, prismarine bricks, sponge, sea lantern and conduit
        broadcast "&a&lDone! &7Now remove this section from your .sk file. (This whole on script load)"
        broadcast "&6This is meant to run one-time only."
       
on mine:
    if gamemode of player is survival:
        if event-world is "Gens":
            clear drops
            set {_fortune} to the level of fortune on player's tool
            set {_no_bonus_chance} to 0 / ({_fortune} + 1)
            set {_rand_pick} to a random number between 1 and 1
            set {_amount} to 1
            if {_rand_pick} is greater than {_no_bonus_chance}:
                if {_fortune} is set:
                    set {_amount} to a random number between ({_fortune} + 1) and ({_fortune} + 1)
            if {genblocks::*} contains type of event-block:
                if player has enough space for 1 barrier:
                    set {_i} to "%type of event-block%" parsed as item
                    give {_amount} of {_i} to player
                else:
                    send "&cYour inventory seems to be full!" to player

command /modifygenblocks [<text>]:
    permission: server.modifygenblocks
    permission message: &cYou do not have permission to execute this command.
    trigger:
        if target block of player is set:
            if target block of player is not air:
                if {genblocks::*} does not contain target block of player:
                    add target block of player to {genblocks::*}
                    send "&aAdded this block to the list!" to player
                else:
                    remove target block of player from {genblocks::*}
                    send "&cRemoved this block from the list!" to player
            else:
                send "&cHmm... I agree, it's a nice view. Just not what I'm looking for however." to player
        else:
            send "&cLook at a block to modify the genblocks list." to player
Hi! I've made some additional changes next to fixing the inventory full problem. I hope this makes it easier for you! :emoji_slight_smile:
ok so a few problems it doesnt stack when it says your inv is full youll have enough for 63 more items and it gives you the block and not coal or iron ingots!
 
Code:
on mine:
    if gamemode of player is survival:
        if event-world is "Gens":
            clear drops
            set {_drop::*} to event-block's drops
            set {_fortune} to the level of fortune on player's tool
            set {_no_bonus_chance} to 0 / ({_fortune} + 1)
            set {_rand_pick} to a random number between 1 and 1
            set {_amount} to 1
            if {_rand_pick} is greater than {_no_bonus_chance}:
                if {_fortune} is set:
                    set {_amount} to a random number between ({_fortune} + 1) and ({_fortune} + 1)
            if {genblocks::*} contains type of event-block:
                if event-block is not any ore:
                    set {_it} to "%{_amount}% %type of event-block%" parsed as itemtype
                    if player has enough space for {_it}:
                        set {_i} to "%type of event-block%" parsed as item
                        give {_amount} of {_i} to player
                    else:
                        send "&cYour inventory seems to be full!" to player
                else:
                    set {_it} to "%{_amount}% %{_drop::*}%" parsed as itemtype
                    if player has enough space for {_it}:
                        set {_i} to "%{_drop::*}%" parsed as item
                        give {_amount} of {_i} to player
                    else:
                        send "&cYour inventory seems to be full!" to player

command /modifygenblocks [<text>]:
    permission: server.modifygenblocks
    permission message: &cYou do not have permission to execute this command.
    trigger:
        if target block of player is set:
            if target block of player is not air:
                if {genblocks::*} does not contain target block of player:
                    add target block of player to {genblocks::*}
                    send "&aAdded this block to the list!" to player
                else:
                    remove target block of player from {genblocks::*}
                    send "&cRemoved this block from the list!" to player
            else:
                send "&cHmm... I agree, it's a nice view. Just not what I'm looking for however." to player
Hello! This should work now. Don't forget to mark it as solved if it does! ^-^
 
Code:
on mine:
    if gamemode of player is survival:
        if event-world is "Gens":
            clear drops
            set {_drop::*} to event-block's drops
            set {_fortune} to the level of fortune on player's tool
            set {_no_bonus_chance} to 0 / ({_fortune} + 1)
            set {_rand_pick} to a random number between 1 and 1
            set {_amount} to 1
            if {_rand_pick} is greater than {_no_bonus_chance}:
                if {_fortune} is set:
                    set {_amount} to a random number between ({_fortune} + 1) and ({_fortune} + 1)
            if {genblocks::*} contains type of event-block:
                if event-block is not any ore:
                    set {_it} to "%{_amount}% %type of event-block%" parsed as itemtype
                    if player has enough space for {_it}:
                        set {_i} to "%type of event-block%" parsed as item
                        give {_amount} of {_i} to player
                    else:
                        send "&cYour inventory seems to be full!" to player
                else:
                    set {_it} to "%{_amount}% %{_drop::*}%" parsed as itemtype
                    if player has enough space for {_it}:
                        set {_i} to "%{_drop::*}%" parsed as item
                        give {_amount} of {_i} to player
                    else:
                        send "&cYour inventory seems to be full!" to player

command /modifygenblocks [<text>]:
    permission: server.modifygenblocks
    permission message: &cYou do not have permission to execute this command.
    trigger:
        if target block of player is set:
            if target block of player is not air:
                if {genblocks::*} does not contain target block of player:
                    add target block of player to {genblocks::*}
                    send "&aAdded this block to the list!" to player
                else:
                    remove target block of player from {genblocks::*}
                    send "&cRemoved this block from the list!" to player
            else:
                send "&cHmm... I agree, it's a nice view. Just not what I'm looking for however." to player
Hello! This should work now. Don't forget to mark it as solved if it does! ^-^
ok so it doesnt give you gold and i want it to auto smelt!
 
Code:
on mine:
    if gamemode of player is survival:
        if event-world is "Gens":
            clear drops
            set {_drop::*} to event-block's drops
            set {_fortune} to the level of fortune on player's tool
            set {_no_bonus_chance} to 0 / ({_fortune} + 1)
            set {_rand_pick} to a random number between 1 and 1
            set {_amount} to 1
            if {_rand_pick} is greater than {_no_bonus_chance}:
                if {_fortune} is set:
                    set {_amount} to a random number between ({_fortune} + 1) and ({_fortune} + 1)
            if {genblocks::*} contains type of event-block:
                if event-block is not any ore:
                    set {_it} to "%{_amount}% %type of event-block%" parsed as itemtype
                    if player has enough space for {_it}:
                        set {_i} to "%type of event-block%" parsed as item
                        give {_amount} of {_i} to player
                    else:
                        send "&cYour inventory seems to be full!" to player
                else:
                    if "%{_drop::*}%" contains "raw":
                        if event-block is not copper ore:
                            set {_s::*} to "%{_drop::*}%" split at " "
                            set {_it} to "%{_amount}% %{_s::2}% ingot" parsed as itemtype
                            set {_i} to "%{_s::2}% ingot" parsed as item
                        else:
                            set {_s::*} to "%{_drop::*}%" split at " "
                            set {_it} to "%{_amount}% %{_s::3}% ingot" parsed as itemtype
                            set {_i} to "%{_s::3}% ingot" parsed as item
                    else:
                        set {_it} to "%{_amount}% %{_drop::*}%" parsed as itemtype
                        set {_i} to "%{_drop::*}%" parsed as item
                    if player has enough space for {_it}:
                        give {_amount} of {_i} to player
                    else:
                        send "&cYour inventory seems to be full!" to player

command /modifygenblocks [<text>]:
    permission: server.modifygenblocks
    permission message: &cYou do not have permission to execute this command.
    trigger:
        if target block of player is set:
            if target block of player is not air:
                if {genblocks::*} does not contain type of target block of player:
                    add type of target block of player to {genblocks::*}
                    send "&aAdded this block to the list!" to player
                else:
                    remove type of target block of player from {genblocks::*}
                    send "&cRemoved this block from the list!" to player
            else:
                send "&cHmm... I agree, it's a nice view. Just not what I'm looking for however." to player
Change the code to this one. Then place a gold block and look at it. Run the /modifygenblocks command while looking at it to add it to the list (seems like I forgot to add gold ore in the list previously). As for auto smelt, hopefully this is what you are looking for! :emoji_slight_smile: Don't forget to set it as the answer if it works this time ^-^
 
Last edited:
Code:
on mine:
    if gamemode of player is survival:
        if event-world is "Gens":
            clear drops
            set {_drop::*} to event-block's drops
            set {_fortune} to the level of fortune on player's tool
            set {_no_bonus_chance} to 0 / ({_fortune} + 1)
            set {_rand_pick} to a random number between 1 and 1
            set {_amount} to 1
            if {_rand_pick} is greater than {_no_bonus_chance}:
                if {_fortune} is set:
                    set {_amount} to a random number between ({_fortune} + 1) and ({_fortune} + 1)
            if {genblocks::*} contains type of event-block:
                if event-block is not any ore:
                    set {_it} to "%{_amount}% %type of event-block%" parsed as itemtype
                    if player has enough space for {_it}:
                        set {_i} to "%type of event-block%" parsed as item
                        give {_amount} of {_i} to player
                    else:
                        send "&cYour inventory seems to be full!" to player
                else:
                    if "%{_drop::*}%" contains "raw":
                        if event-block is not copper ore:
                            set {_s::*} to "%{_drop::*}%" split at " "
                            set {_it} to "%{_amount}% %{_s::2}% ingot" parsed as itemtype
                            set {_i} to "%{_s::2}% ingot" parsed as item
                        else:
                            set {_s::*} to "%{_drop::*}%" split at " "
                            set {_it} to "%{_amount}% %{_s::3}% ingot" parsed as itemtype
                            set {_i} to "%{_s::3}% ingot" parsed as item
                    else:
                        set {_it} to "%{_amount}% %{_drop::*}%" parsed as itemtype
                        set {_i} to "%{_drop::*}%" parsed as item
                    if player has enough space for {_it}:
                        give {_amount} of {_i} to player
                    else:
                        send "&cYour inventory seems to be full!" to player

command /modifygenblocks [<text>]:
    permission: server.modifygenblocks
    permission message: &cYou do not have permission to execute this command.
    trigger:
        if target block of player is set:
            if target block of player is not air:
                if {genblocks::*} does not contain type of target block of player:
                    add type of target block of player to {genblocks::*}
                    send "&aAdded this block to the list!" to player
                else:
                    remove type of target block of player from {genblocks::*}
                    send "&cRemoved this block from the list!" to player
            else:
                send "&cHmm... I agree, it's a nice view. Just not what I'm looking for however." to player
Change the code to this one. Then place a gold block and look at it. Run the /modifygenblocks command while looking at it to add it to the list (seems like I forgot to add gold ore in the list previously). As for auto smelt, hopefully this is what you are looking for! :emoji_slight_smile: Don't forget to set it as the answer if it works this time ^-^
ok so the auto smelt doesnt give netherite ingots when you mine ancient debris and i want stone to give cobblr stone
 
First of all, smelted ancient debris isn’t a netherite ingot
Second of all,
There’s public scripts for this
Well Shroob my auto pickup script 1. works better then public ones and 2. does give netherite ingots when mining ancient debris OK!
 
Well Shroob my auto pickup script 1. works better then public ones and 2. does give netherite ingots when mining ancient debris OK!
your autopickup used to have 20 conditionals, but this forum is not for arguing so I’d just recommend u use a public script
 
your autopickup used to have 20 conditionals, but this forum is not for arguing so I’d just recommend u use a public script
public scripts are annoying to edit if you have something better like actually how to add what i want just say it
 
i just want a mini script that i can add to my script and that tells players their inventory is full. ok?!
How would you get anything done on your own if I just give you the answer, also I don’t know what the old script was meant to do as the programmer didn’t add comments and could have just used %smelted item%
 
How would you get anything done on your own if I just give you the answer, also I don’t know what the old script was meant to do as the programmer didn’t add comments and could have just used %smelted item%
just either give me the answer what your meant to do on forums or leave! ok?!