Items not stacking in skript

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

Status
Not open for further replies.

MMCOnnOrZeUs

Member
Nov 20, 2021
1
0
1
22
So basically im trying to make an auto compressor so if you have 64 of a certain item you get on if it and if you have multiple stacks it turns into a few.

here is the code:

every 2 ticks:
loop all players:
if {%loop-player%.enabled} is true:
if loop-player has 64 dirt or 64 oak log or 64 cobblestone or 64 coal or 64 raw iron or 64 raw gold or 64 redstone or 64 lapis or 64 diamond or 64 ancient debris or 64 obsidian or 64 emerald:
replace all 64 dirt in loop-player's inventory with dirt of unbreaking 1 with enchants flag hidden named "&6&lGiga Dirt"
replace all 64 oak log in loop-player's inventory with oak log of unbreaking 1 with enchants flag hidden named "&6&lGiga Wood"
replace all 64 cobblestone in loop-player's inventory with stone of unbreaking 1 with enchants flag hidden named "&6&lGiga Stone"
replace all 64 coal in loop-player's inventory with coal block of unbreaking 1 with enchants flag hidden named "&6&lGiga Coal"
replace all 64 raw iron in loop-player's inventory with iron block of unbreaking 1 with enchants flag hidden named "&6&lGiga Iron"
replace all 64 raw gold in loop-player's inventory with gold block of unbreaking 1 with enchants flag hidden named "&6&lGiga Gold"
replace all 64 redstone in loop-player's inventory with redstone block of unbreaking 1 with enchants flag hidden named "&6&lGiga Redstone"
replace all 64 lapis in loop-player's inventory with lapis block of unbreaking 1 with enchants flag hidden named "&6&lGiga Lapis"
replace all 64 diamond in loop-player's inventory with diamond block of unbreaking 1 with enchants flag hidden named "&6&lGiga Diamond"
replace all 64 ancient debris in loop-player's inventory with netherite block of unbreaking 1 with enchants flag hidden named "&6&lGiga Netherite"
replace all 64 obsidian in loop-player's inventory with obsidian of unbreaking 1 with enchants flag hidden named "&6&lGiga Obsidian"
replace all 64 emerald in loop-player's inventory with emerald block of unbreaking 1 with enchants flag hidden named "&6&lGiga Emerald"
e​
 
Firstly, format your code correctly next time, please:
upload_2021-11-23_14-34-24.png

Secondly, don't use 'every' event (especially with ticks!) as it will lag your server unbearably and pretty much may crash it. Try to find different events like 'on pickup' etc...

Thirdly, I think that your code may also count your compressed block into the 64 it is trying to achieve. You may have to add a condition that makes sure it's name doesn't equal '&6&lGiga Obsidian', '&6&lGiga Emerald' etc...

Lastly, you haven't told us where's the error.
 
im pretty sure its a minecraft think and not a skript one, and every time there is a compressed two stacks items i think its a glitch
 
Status
Not open for further replies.