Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto_pickup.sc Stopping At 2 Items Per Stack #391

Open
AKA-Mae opened this issue Jun 15, 2024 · 4 comments
Open

auto_pickup.sc Stopping At 2 Items Per Stack #391

AKA-Mae opened this issue Jun 15, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@AKA-Mae
Copy link

AKA-Mae commented Jun 15, 2024

Describe the bug
When using auto_pickup.sc multiple stacks of 2 will be created and if there are no more empty slots will drop on the ground.

To Reproduce
Steps to reproduce the behavior:

  1. Use /script download survival/auto_pickup.sc to download and enable the script
  2. Have 3 blocks of the same type in world to break
  3. Fill all inventory slots except 1 with something other than the block you're going to break
  4. Break the 3 blocks
  5. The first 2 will be automatically moved to your inventory in that empty slot, the third will drop as if there is no more room

Expected behavior
Items should continue filling the inventory until stacks are full. I have tested this with multiple items, such as wooden planks and redstone dust.

Screenshots
image

Environment

  • Carpet version: 1.4.141+v240429
  • Minecraft version: 1.20.6

Additional context
I noticed this first in a modded server, then tested with a fresh install of 1.20.6 and only carpet-fabric installed.

@AKA-Mae AKA-Mae added the bug Something isn't working label Jun 15, 2024
@AKA-Mae
Copy link
Author

AKA-Mae commented Jun 15, 2024

I just started using Carpet mod yesterday, so I'm not familiar with the syntax for scarpet, but I feel like the if ( current:1+count <= stack_limit(item_name) && current:2 == item_nbt, line may be the problem

@rv3r
Copy link
Collaborator

rv3r commented Jun 15, 2024

You are correct about the problematic line. I solved this on discord already, but unfortunately we haven't decided on how to update scripts to keep them backwards compatible.

Update line 47 to
if ( current:1+count <= stack_limit(item_name) && current:2:'components' == item_nbt:'components',

https://discord.com/channels/882822986795716608/894811484062892095/1246920279020671089

@AKA-Mae
Copy link
Author

AKA-Mae commented Jun 15, 2024

Thank you for the fix! I'll join the discord to check for some more fixes on other scripts then.

@manchesterjm
Copy link

manchesterjm commented Jun 21, 2024

I updated the script with that fix, and it works fine now in 1.21. Thanks for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants