Posted January 14, 20223 yr Title Code : package io.github.wallibed.magicalmod.core.init; import io.github.wallibed.magicalmod.MagicalMod; import net.minecraftforge.fmllegacy.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraftforge.registries.ForgeRegistries; import java.util.List; import java.util.Map; import javax.annotation.Nullable; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.network.chat.Component; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.ShulkerBoxBlock; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.Property; import net.minecraft.world.level.gameevent.GameEvent; import net.minecraft.world.phys.shapes.CollisionContext; public final class ItemInit { private ItemInit() {} public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MagicalMod.MODID); static final RegistryObject<Item> SOULS = ITEMS.register("souls", () -> new Item(new Item.Properties().tab(CreativeModeTab.TAB_MISC).fireResistant())); //Block Items public static final RegistryObject<BlockItem> SOUL_BLOCK_ITEM = ITEMS.register("compressed_souls_block", () -> new BlockItem(BlockInit.COMPRESSED_SOULS_BLOCK.get(), new Item(new Item.Properties().tab(CreativeModeTab.TAB_MISC)))); } NO ONE CARES THAT I IMPORTED 35 THINGS
January 14, 20223 yr Learn basic java since Item != Item.Properties for solving this problem yourself take a look into the BlockItem constructor and the required parameters Edited January 14, 20223 yr by Luis_ST
January 23, 20223 yr On 1/14/2022 at 2:57 AM, Bedwa said: () -> new BlockItem(BlockInit.COMPRESSED_SOULS_BLOCK.get(), new Item(new Item.Properties().tab(CreativeModeTab.TAB_MISC)))); Remove new Item(); New code: () -> new BlockItem(BlockInit.COMPRESSED_SOULS_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_MISC)));
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.