1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Deleting non named items

Discussion in 'Skript' started by AverageGamer590, Jul 8, 2021.

Thread Status:
Not open for further replies.
  1. AverageGamer590

    AverageGamer590 New Member

    Joined:
    Jun 27, 2021
    Messages:
    6
    Likes Received:
    0
    1. Script Version: 2.5.3MH and using skRayFall v1.9.25
    2. Script Author: me
    3. Minecraft Version: 1.16.5
    4. Full Code:
      on break:
      if player has oak plank named "&6Oak AutoCompressor":
      if player has 64 of oak log:
      give player shiny oak log
      remove 64 of oak log from player's inventory
    I'm trying to only remove regular oak logs that aren't shiny and don't have a name so it doesn't remove the anything else
     
    #1 AverageGamer590, Jul 8, 2021
    Last edited: Jul 8, 2021
  2. AHappyLittleSloth

    Joined:
    Apr 22, 2020
    Messages:
    48
    Likes Received:
    4
    try
    Code (Text):
    1. remove 64 oak log named "Oak Log" from player's inventory
     
  3. AverageGamer590

    AverageGamer590 New Member

    Joined:
    Jun 27, 2021
    Messages:
    6
    Likes Received:
    0
    doesn't work
     
  4. rustedst

    rustedst Active Member

    Joined:
    Apr 24, 2020
    Messages:
    97
    Likes Received:
    4
    Code (Text):
    1. loop player's inventory:
    2.     if name of loop-item is "Oak Log":
    3.         remove 64 of loop-item from player's inventory
    if that doesn't work for some reason, try this:

    Code (Text):
    1. set {_count} to 0
    2. loop player's inventory:
    3.     if name of loop-item is "Oak Log":
    4.         if {_count} is less than 65:
    5.             remove loop-item from player's inventory
    6.             set {_count} to {_count} + 1
     
Thread Status:
Not open for further replies.

Share This Page

Loading...