RESOLVED: Trying to build a simple automated Fishing block, but the fish metadata is being ignored

Started by Impshial on Sun, 01/19/2020 - 16:11

Topic category: Help with modding (Java Edition)

Last seen on 16:14, 22. Mar 2020
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RESOLVED: Trying to build a simple automated Fishing block, but the fish metadata is being ignored
Tue, 01/21/2020 - 16:38 (edited)

So here's the concept: A block that is currently powered by a redstone signal, that when placed over a water block, randomly catches fish and places them into an internal inventory.

I have the functionality completed, but when it adds a new fish to the inventory, it overwrites the first fish it finds.

I'm doing a successful loop through the inventory slots to find empty slots or slots that already contain a < 64 count stack of the same kind of fish. I know this part works because it doesn't replace items that aren't fish in any of the slots. 

But as soon as it gets to any fish (regular/salmon/clown/puffer), it replaces the old fish with the new, and increments the number of fish by 1.

I've looked at the code and the metadata values are there, but when the block runs, it just ignores them. I have created an issue tag, but the devs told me that if the metadata is there, it should be working just fine.

It's not.

I can provide code, procedure, project files, etc if anyone can help me.

Thank you

RESOLVED: So I discovered that the 2020 versions (including the snapshots) of MCreator do not have the == compare procedure block anymore. They were removed because Minecraft 1.13+ flattened metadata, and removed the need for it. 

I was able to resolve my issue by opening MCreator 1.9.1 and creating a generic procedure with the == blocks, then exporting that procedure. Jumping over to 2020 versions, I am able to import that generic procedure with the == blocks where they work like they used to. 

I was told by the devs that this was acceptable because they want to allow backward compatibility to 1.12.

The == blocks allowed me to successfully compare metadata, fixing my issue.

Edited by Impshial on Tue, 01/21/2020 - 16:38
Last seen on 13:59, 24. Oct 2020
Joined Apr 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I can try.
Sun, 01/19/2020 - 18:22

I can try.

Last seen on 16:14, 22. Mar 2020
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I've packed the whole test…
Sun, 01/19/2020 - 18:51

I've packed the whole test project into a dropbox folder. Here's the link to download:

https://www.dropbox.com/s/smati3u1klzmxhk/ReloadedPack.zip?dl=1

You basically place a Fisher over a water block, power it with redstone (lever/torch/etc) and let it run. I have some debug messages running in chat to show me number values, slot searching results, etc.

Let me know if you find any issues.

Thanks for the extra set of eyes!