Hey there, I've been trying to change a vanilla item into being a blockitem for a block my mod is adding.
I've been trying mixins, but I'm pretty new to them so I've not quite been able to wrap my head around them.
The item i'm trying to change is Items.FLINT
@Mixin(Items.class)
public abstract class ItemsMixin {
@ModifyArg(method = "<clinit>", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Items;register(Ljava/lang/String;Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item;"), index = 1)
private Item mixin(Item item) {
return new BlockItem(ModBlocks.FLINT_ROCK, new Item.Settings());
}
}
I know the target is wrong since I haven't specified which defintion to target but I'm unsure how, was just wondering if anyone could point out the correct way to do this or even if mixins are the right way to go.
As far as I understand also I could use an accessor to change the item, but so long as it isn't final?
thanks