Jump to content

[SOLVED]Null Pointer Exception when registering tile entity


Atm2222

Recommended Posts

Hello, I am following along with McJty's 1.12 modding tutorials and am at the point where I am creating a Tile Entity. I have followed the tutorial and there are no errors in IntelliJ. However, when I try to load the game it crashes.

I was stupid and forgot to change something from his tutorial to fit my mod. 

Crash Log:

Spoiler

---- Minecraft Crash Report ----
// Ooh. Shiny.

Time: 7/15/17 5:49 PM
Description: Initializing game

java.lang.NullPointerException: Initializing game
    at atm2222.firstmod.proxy.CommonProxy.registerItems(CommonProxy.java:60)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_5_CommonProxy_registerItems_Register.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179)
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:723)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:605)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:266)
    at net.minecraft.client.Minecraft.init(Minecraft.java:508)
    at net.minecraft.client.Minecraft.run(Minecraft.java:416)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
    at atm2222.firstmod.proxy.CommonProxy.registerItems(CommonProxy.java:60)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_5_CommonProxy_registerItems_Register.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179)
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:723)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:605)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:266)
    at net.minecraft.client.Minecraft.init(Minecraft.java:508)

-- Initialization --
Details:
Stacktrace:
    at net.minecraft.client.Minecraft.run(Minecraft.java:416)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

-- System Details --
Details:
    Minecraft Version: 1.12
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_73, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 819777688 bytes (781 MB) / 1007157248 bytes (960 MB) up to 3808428032 bytes (3632 MB)
    JVM Flags: 0 total; 
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.40 Powered by Forge 14.21.1.2413 5 mods loaded, 5 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCH    minecraft{1.12} [Minecraft] (minecraft.jar) 
    UCH    mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
    UCH    FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.12-14.21.1.2413.jar) 
    UCH    forge{14.21.1.2413} [Minecraft Forge] (forgeSrc-1.12-14.21.1.2413.jar) 
    UCH    firstmod{0.0.1} [Atm2222s First Mod] (FirstMod_main) 
    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13474 Compatibility Profile Context 22.19.162.4' Renderer: 'AMD Radeon R9 200 Series'
    Launched Version: 1.12
    LWJGL: 2.9.4
    OpenGL: AMD Radeon R9 200 Series GL version 4.5.13474 Compatibility Profile Context 22.19.162.4, ATI Technologies Inc.
    GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: 
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    CPU: 4x Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz

 

From this log, I know it occurs on line 60 or my CommonProxy Method.

CommonProxy:

Spoiler

package atm2222.firstmod.proxy;

import atm2222.firstmod.Config;
import atm2222.firstmod.FirstMod;
import atm2222.firstmod.ModBlocks;
import atm2222.firstmod.blocks.FirstBlock;
import atm2222.firstmod.blocks.datablock.DataBlock;
import atm2222.firstmod.blocks.datablock.DataTileEntity;
import atm2222.firstmod.items.FirstItem;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;

import java.io.File;

@Mod.EventBusSubscriber
public class CommonProxy {

    // Config instance
    public static Configuration config;

    public void preInit(FMLPreInitializationEvent e) {
        File directory = e.getModConfigurationDirectory();
        config = new Configuration(new File(directory.getPath(), "modtut.cfg"));
        Config.readConfig();
    }

    public void init(FMLInitializationEvent e) {
    }

    public void postInit(FMLPostInitializationEvent e) {
        if (config.hasChanged()) {
            config.save();
        }
    }

    @SubscribeEvent
    public static void registerBlocks(RegistryEvent.Register<Block> event) {
        event.getRegistry().register(new FirstBlock());

        event.getRegistry().register(new DataBlock());
        GameRegistry.registerTileEntity(DataTileEntity.class, FirstMod.MODID + "_datablock");
    }

    @SubscribeEvent
    public static void registerItems(RegistryEvent.Register<Item> event) {
        event.getRegistry().register(new ItemBlock(ModBlocks.firstBlock).setRegistryName(ModBlocks.firstBlock.getRegistryName()));

        event.getRegistry().register(new ItemBlock(ModBlocks.dataBlock).setRegistryName(ModBlocks.dataBlock.getRegistryName()));


        event.getRegistry().register(new FirstItem());

    }
}
 

Here are the two files pertaining to the TileEntity.

Spoiler

package atm2222.firstmod.blocks.datablock;

import atm2222.firstmod.FirstMod;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.util.List;

public class DataBlock extends Block implements ITileEntityProvider{

    public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);

    public DataBlock() {
        super(Material.ROCK);
        setUnlocalizedName(FirstMod.MODID + ".datablock");
        setRegistryName("datablock");
    }

    @SideOnly(Side.CLIENT)
    public void initModel() {
        ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
    }

    @Override
    public TileEntity createNewTileEntity(World worldIn, int meta) {
        return new DataTileEntity();
    }

    private DataTileEntity getTE(World world, BlockPos pos) {
        return (DataTileEntity) world.getTileEntity(pos);
    }

    //@Override
    public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand,
    ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
        if (!world.isRemote) {
            // We only count on the server side.

            if (side == state.getValue(FACING)) {
                int counter;
                if (hitY < .5f) {
                    counter = getTE(world, pos).decrement();
                } else {
                    counter = getTE(world, pos).increment();
                }
                player.sendStatusMessage(new TextComponentString(TextFormatting.GREEN + "Counter: " + counter), false);
            }
        }
        // Return true also on the client to make sure that MC knows we handled this and will not try to place
        // a block on the client
        return true;
    }

    @Override
    public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
        world.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2);
    }

    @Override
    public IBlockState getStateFromMeta(int meta) {
        // Since we only allow horizontal rotation we need only 2 bits for facing. North, South, West, East start at index 2 so we have to add 2 here.
        return getDefaultState().withProperty(FACING, EnumFacing.getFront((meta & 3) + 2));
    }

    @Override
    public int getMetaFromState(IBlockState state) {
        // Since we only allow horizontal rotation we need only 2 bits for facing. North, South, West, East start at index 2 so we have to subtract 2 here.
        return state.getValue(FACING).getIndex()-2;
    }

    @Override
    protected BlockStateContainer createBlockState() {
        return new BlockStateContainer(this, FACING);
    }
}
 
Spoiler

package atm2222.firstmod.blocks.datablock;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;

public class DataTileEntity extends TileEntity{

    private int counter = 0;

    public int decrement() {
        counter--;
        markDirty();
        return counter;
    }

    public int increment() {
        counter++;
        markDirty();
        return counter;
    }

    @Override
    public void readFromNBT(NBTTagCompound compound) {
        super.readFromNBT(compound);
        counter = compound.getInteger("counter");
    }

    @Override
    public NBTTagCompound writeToNBT(NBTTagCompound compound) {
        super.writeToNBT(compound);
        compound.setInteger("counter", counter);
        return compound;
    }
}
 

Here is another possibly important class:

Spoiler

package atm2222.firstmod;

import atm2222.firstmod.blocks.FirstBlock;
import atm2222.firstmod.blocks.datablock.DataBlock;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ModBlocks {

    @SideOnly(Side.CLIENT)
    public static void initModels() {
        dataBlock.initModel();
    }
    @GameRegistry.ObjectHolder("firstmod:firstblock")
    public static FirstBlock firstBlock;

    @GameRegistry.ObjectHolder("modtut:datablock")
    public static DataBlock dataBlock;


}
 

If anybody knows of any common causes of this issue, please tell me!

 

Thanks!!

Edited by Atm2222
Problem Solved
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • It is the field that accesses the portal entrance position relative to the entity. So very much needed to make a portal work. What I don't understand is why the access widener works when running the client in Intellij but doesn't after I publish the jar and try to play with game with it.
    • So I'm using a mod that adds a "god sword" into the game. This sword is unfortunately not enchantable so I'm looking to change it. The only code that seems related is in the weapon's .class file which is here:  public int getItemEnchantability() { return this.tier.m_6601_(); }   The entire file is below: package blackwolf00.elementalswords.common; import blackwolf00.elementalswords.config.ConfigEffects; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; import com.mojang.blaze3d.platform.InputConstants; import java.util.List; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Tier; import net.minecraft.world.item.TieredItem; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.item.Vanishable; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.ToolAction; import net.minecraftforge.common.ToolActions; public class FusionSword extends TieredItem implements Vanishable { private final float totalDamage; private final Tier tier; private final Multimap<Attribute, AttributeModifier> defaultModifiers; public FusionSword(Tier tierIn, int damage, float speed, Item.Properties builderIn) { super(tierIn, builderIn); this.tier = tierIn; this.totalDamage = damage + this.tier.m_6631_(); ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder(); builder.put(Attributes.f_22281_, new AttributeModifier(f_41374_, "Weapon modifier", this.totalDamage, AttributeModifier.Operation.ADDITION)); builder.put(Attributes.f_22283_, new AttributeModifier(f_41375_, "Weapon modifier", speed, AttributeModifier.Operation.ADDITION)); this.defaultModifiers = (Multimap<Attribute, AttributeModifier>)builder.build(); } public int getItemEnchantability() { return this.tier.m_6601_(); } public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { return (this.tier.m_6282_().test(repair) || isRepairable(toRepair)); } public float getAttackDamage() { return this.totalDamage; } public boolean m_6777_(BlockState state, Level level, BlockPos pos, Player player) { return !player.m_7500_(); } public float m_8102_(ItemStack stack, BlockState state) { return 1.0F; } public boolean m_7579_(ItemStack stack, LivingEntity target, LivingEntity attacker) { stack.m_41622_(1, attacker, entity -> entity.m_21166_(EquipmentSlot.MAINHAND)); return true; } public boolean m_6813_(ItemStack stack, Level level, BlockState state, BlockPos pos, LivingEntity entityLiving) { if (state.m_60800_((BlockGetter)level, pos) != 0.0F) stack.m_41622_(2, entityLiving, entity -> entity.m_21166_(EquipmentSlot.MAINHAND)); return true; } public boolean m_8096_(BlockState blockIn) { return blockIn.m_60713_(Blocks.f_50033_); } public boolean m_5812_(ItemStack item) { return true; } public Multimap<Attribute, AttributeModifier> m_7167_(EquipmentSlot equipmentSlot) { return (equipmentSlot == EquipmentSlot.MAINHAND) ? this.defaultModifiers : super.m_7167_(equipmentSlot); } public boolean onLeftClickEntity(ItemStack stack, Player player, Entity entity) { return super.onLeftClickEntity(stack, player, entity); } @OnlyIn(Dist.CLIENT) public void m_7373_(ItemStack stack, Level level, List<Component> tooltip, TooltipFlag flag) { super.m_7373_(stack, level, tooltip, flag); if (InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 340)) { tooltip.add(Component.m_237115_("tooltip.fusion_sword").m_130940_(ChatFormatting.GRAY)); } else { tooltip.add(Component.m_237115_("tooltip.hold_shift").m_130940_(ChatFormatting.GRAY)); } } public InteractionResultHolder<ItemStack> m_7203_(Level level, Player playerIn, InteractionHand handIn) { if (((Boolean)ConfigEffects.JUMP_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19603_, 10000, ((Integer)ConfigEffects.JUMP_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.MOVEMENT_SPEED_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19596_, 10000, ((Integer)ConfigEffects.MOVEMENT_SPEED_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.SLOW_FALLING_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19591_, 10000, ((Integer)ConfigEffects.SLOW_FALLING_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.ABSORPTION_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19617_, 10000, ((Integer)ConfigEffects.ABSORPTION_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.DAMAGE_RESISTANCE_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19606_, 10000, ((Integer)ConfigEffects.DAMAGE_RESISTANCE_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.DAMAGE_BOOST_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19600_, 10000, ((Integer)ConfigEffects.DAMAGE_BOOST_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.CONDUIT_POWER_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19592_, 10000, ((Integer)ConfigEffects.CONDUIT_POWER_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.DOLPHINS_GRACE_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19593_, 10000, ((Integer)ConfigEffects.DOLPHINS_GRACE_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.WATER_BREATHING_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19608_, 10000, ((Integer)ConfigEffects.WATER_BREATHING_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.FIRE_RESISTANCE_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19607_, 10000, ((Integer)ConfigEffects.FIRE_RESISTANCE_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.HEALTH_BOOST_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19616_, 10000, ((Integer)ConfigEffects.HEALTH_BOOST_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.REGENERATION_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19605_, 10000, ((Integer)ConfigEffects.REGENERATION_F_LEVEL.get()).intValue() - 1)); return InteractionResultHolder.m_19098_(playerIn.m_21120_(handIn)); } public boolean canPerformAction(ItemStack stack, ToolAction toolAction) { return ToolActions.DEFAULT_SWORD_ACTIONS.contains(toolAction); } } How do I make this thing enchantable?  
    • The mod I'm working on is in 1.19.2. The portal works correctly in Intellij but when I publish the jar, put it in the mods folder of the game it crashes with the following error whenever any entity collides with it: java.lang.IllegalAccessError: class com.github.warrentode.turtleblockacademy.blocks.TBAMiningPortalBlock tried to access protected field net.minecraft.world.entity.Entity.f_19819_ (com.github.warrentode.turtleblockacademy.blocks.TBAMiningPortalBlock is in module [email protected] of loader 'TRANSFORMER' @16c5b50a; net.minecraft.world.entity.Entity is in module [email protected] of loader 'TRANSFORMER' @16c5b50a)     at com.github.warrentode.turtleblockacademy.blocks.TBAMiningPortalBlock.m_7892_(TBAMiningPortalBlock.java:124) ~[turtleblockacademy-2024.2025-1.0.0.jar%23572!/:2024.2025-1.0.0] {re:classloading} The thing is, I have Entity.f_19819_ in my accessTransformer.cfg file in this line: public net.minecraft.world.entity.Entity f_19819_ # portalEntrancePos So what do I need to do to fix this error?
    • It will be about medeaival times
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.