#Adding Custom Attributes AND Enabling Them For Living Entities [SOLVED]

48 messages ยท Page 1 of 1 (latest)

sharp rune
#

Its Been 6 Day... Help

I Figured Out Adding Them, But When Appling Them To The Player It Says The Player Or Any Entity Doesn't Take This Attribute. I've Figuered Out It Has To Do With Living Entities Mixin So I Tried That And I Didn't Get Anywhere Probably Because Mixin Is Before The Mod Loads. How Do I Do The Thing I Need To Make The Attribute Apply To The Player. Please Send Example On How To Make It Work.

bitter spoke
#

Use ModifyReturnValue instead of Inject

sharp rune
bitter spoke
#

Define "doesn't work"

sharp rune
#

Im Still At The Same Place I Was Where The Attribute Is There But Its Not Assigned To Any Entity

bitter spoke
#

Yes because you added it to the container (so the container knows the attribute is valid) but you didn't specify a value (still 0)

radiant breach
#

Your original Mixin seems fine, it is the same I use for 1.21.1. There is most likely some different issue causing the attribute to fail

bitter spoke
#

Depends

#

How are you planning to add the value

#

What are you adding it to

sharp rune
bitter spoke
#

Okay so make an enchantment attribute modifier

sharp rune
bitter spoke
#

Please stop replying pinging me

#

I'm right here

sharp rune
#

Ok

#

Im Using An Attribute Because Im Making An Enchantment, However Its Would Be Going Through Commands For Testing Preposes And So Ill Be Able To Enable It Whenever, So While Its Made For Enchantments, Its Meant To Be Used Just Like A Normal Attribute

bitter spoke
#

Okay

#

You have succeeded

sharp rune
#

I Beg To Differ

bitter spoke
#

Show your mixins.json

sharp rune
#

It Has Not Changed Becuase I Dont Know Where To Put The Value

bitter spoke
#

Show it anyway

sharp rune
bitter spoke
#

I know what I said

#

I want to see your mixins.json

sharp rune
#

That Might Explain It Since I Have No .json File

bitter spoke
#

In the resources folder there should be a file named modid.mixins.json

sharp rune
#

I Found It Im Just Blind

#

I Sewer If This Is It Im Going To Cry Myslef To Sleep

#

GoodNight

#

Today I Learnt mixins.json exsist

bitter spoke
#

!!mcdev

graceful basinBOT
#
Minecraft Dev for IntelliJ (MCDEV)

MCDEV is an open source IntelliJ IDEA plugin that provides first class support for Minecraft development. It provides useful functionalities like Mixin method/target autocompletion, Mixin debugging capabilities and other common Fabric/Minecraft related inspections.

bitter spoke
#

Get this (intellij) and it will help you with mixins a lot

sharp rune
#

I Using It Right Now

bitter spoke
#

Warns you that mixins aren't added to mixins.json and then adds them for you :)

#

There should be a yellow warning line under your mixin class definition then

sharp rune
#

I Wondered What That Was

#

Well Thanks For The Help

bitter spoke
#

You should put your cursor over it and look then

#

Try it first

#

And ensure your problem is actually solved

sharp rune
#

I Did

#

And Now Ill Close The Post

bitter spoke
#

๐Ÿ‘