How to completely remove an 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 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!

kubur

Member
May 2, 2025
2
0
1
i have been modifying this Infuse SMP plugin made by Spork3r to make it compatible with 1.21.4, but im currently very stumped on this one problem, everytime i drink a potion its supposed to remove the glass bottle immediately, but for some odd reason it always leaves one single bottle in my inventory. So for example: when i drink the first potion, the empty bottle doesnt get removed, but when i drink the 2nd one, it removes the empty bottle, although it always leaves one bottle.

on drink:
if lore of event-item contains "&9Primary Effect":
if player's gamemode is not creative:
remove 2 glass bottle from player's inventory
else:
remove 2 of event-item from player's inventory

else if lore of event-item contains "&9Support Effect":
if player's gamemode is not creative:
remove 2 glass bottle from player's inventory
else:
remove 2 of event-item from player's inventory

I've tried increasing the amount of glass bottles removed but for some reason it always leaves one in my inventory, this problem is really irritating, please help!
P.S, there is no error code or whatsoever in my servers console
 
i have been modifying this Infuse SMP plugin made by Spork3r to make it compatible with 1.21.4, but im currently very stumped on this one problem, everytime i drink a potion its supposed to remove the glass bottle immediately, but for some odd reason it always leaves one single bottle in my inventory. So for example: when i drink the first potion, the empty bottle doesnt get removed, but when i drink the 2nd one, it removes the empty bottle, although it always leaves one bottle.

on drink:
if lore of event-item contains "&9Primary Effect":
if player's gamemode is not creative:
remove 2 glass bottle from player's inventory
else:
remove 2 of event-item from player's inventory

else if lore of event-item contains "&9Support Effect":
if player's gamemode is not creative:
remove 2 glass bottle from player's inventory
else:
remove 2 of event-item from player's inventory

I've tried increasing the amount of glass bottles removed but for some reason it always leaves one in my inventory, this problem is really irritating, please help!
P.S, there is no error code or whatsoever in my servers console
Python:
on drink:
    stop if gamemode of player is creative
    
    wait a tick
    remove glass bottle from player's inventory

"wait a tick" should work.
 
  • Like
Reactions: Merrical