Attempting to access NBT data from another mod

Started by christiananderson on

Topic category: Advanced modding

Active 10 months ago
Joined Nov 2024
Points:
51

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
Attempting to access NBT data from another mod

I'm trying to use MCreator to bridge a mod that includes RPG elements to another mod's weapons. The short version is that Mod A increases weapon damage for its weapons using weapon damage + strength, but for some reason this only works on weapons from that mod and vanilla weapons. I want Mod B to also benefit from this bonus damage from strength.

I know how to add the damage, I've done it before with another project of mine, but I am struggling to access that value in the player NBT data. From what I can tell, everything in MCreator operates under the Forge Data list, but the NBT tag I need to access is in the Forge Caps list. Is there any way I can access this data, including using custom code?

Active 10 months ago
Joined Nov 2024
Points:
51

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
I found a way to do it using…
Thu, 11/21/2024 - 23:01

I found a way to do it using custom code blocks. Found a tutorial from another post that was talking about vanilla nbt tags here

Only thing that had to be changed is when you are getting a compound tag from another compound tag, you need to use .getCompound instead of .get

Seriously, props to RedWirePlatinum, their tutorial was very concise and helpful!