#change item max stack size

9 messages · Page 1 of 1 (latest)

inland knot
#

i am trying to make mod to make music discs stackable to 16, so far i have:```java
@Mixin(Items.class)
public class ItemsMixin {
@WrapOperation
(method = "register(Ljava/lang/String;Lnet/minecraft/item/Item$Settings;)Lnet/minecraft/item/Item;",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/item/Items;register(Lnet/minecraft/registry/RegistryKey;Ljava/util/function/Function;Lnet/minecraft/item/Item$Settings;)Lnet/minecraft/item/Item;"))
private static Item changeStack(RegistryKey<Item> key, Function<Item.Settings, Item> factory, Item.Settings settings, Operation<Item> original) {
if (key.getValue().getPath().contains("music_disc"))
settings.maxCount(16);
return original.call(key, factory, settings);
}
}

#

(also i know this is a bad way to filter for music discs but it's for a private server so i don't really care)

zinc torrent
#

isn't that doable in vanilla with a datapack ?

zinc torrent
#

if you don't want to do it with a datapack, you could change the default component of the item when it's created

inland knot
#

ok i will try that

zinc torrent
#

that way the client will be able to deal with it

#

you can make it a server-side only mod

#

it'll likely be more optimized than a datapack