Jump to content

Recommended Posts

Posted (edited)

I tried this but nothing

Main Class

package com.clowcadia.test;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

@Mod(modid = TestModHandler.modId, name = TestModHandler.name, version = TestModHandler.version)
public class TestModHandler {
	public static final String modId = "testmod";
	public static final String name = "Test Mod";
	public static final String version = "1.0.0";
	
	@Mod.Instance(modId)
	public static TestModHandler instance;
	
	@SidedProxy(serverSide = "com.clowcadia.test.CommonProxy", clientSide = "com.clowcadia.test.ClientProxy")
	public static CommonProxy proxy;
	
	@EventHandler
	public void preInit(FMLPreInitializationEvent event){
		NPCHandler.registerNPCs();
		proxy.registerTileEntities();
	}
	
	@EventHandler
	public void init(FMLInitializationEvent event){
		proxy.init();
	}
	
	@EventHandler
	public void postInit(FMLPostInitializationEvent event){
		
	}
}

CommonProxy

package com.clowcadia.test;

import com.clowcadia.test.tileentities.TileEntityBasic;

import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class CommonProxy {
	
	public void registerTileEntities(){
		GameRegistry.registerTileEntity(TileEntityBasic.class, TestModHandler.modId+"basic");
	}

	public void init() {
		NetworkRegistry.INSTANCE.registerGuiHandler(TestModHandler.instance, new GuiHandler());
		
	}

}

ClientProxy

package com.clowcadia.test;

import com.clowcadia.test.NPCHandler;
import com.clowcadia.test.tileentities.TileEntityBasic;

import net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ClientProxy extends CommonProxy{
	
	@Override
	public void init(){
		NetworkRegistry.INSTANCE.registerGuiHandler(TestModHandler.instance, new GuiHandler());
	}

}

NPCHandler

package com.clowcadia.test;

import com.clowcadia.test.npc.Basic;

import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.EntityRegistry;

public class NPCHandler {
	
	public static void registerNPCs(){
		EntityRegistry.registerModEntity(new ResourceLocation(TestModHandler.modId,"basicNPC"), Basic.class, "BasicNPC", 
				0, TestModHandler.instance, 64, 1, true, 0x4286f4, 0x606e84);
	}

}

NPC Basic

package com.clowcadia.test.npc;

import com.clowcadia.test.GuiHandler;
import com.clowcadia.test.TestModHandler;
import com.clowcadia.test.tileentities.TileEntityBasic;

import net.minecraft.block.ITileEntityProvider;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;

public class Basic extends EntityLiving implements ITileEntityProvider{
	
	public Basic(World world) 
	{			
		super(world);
	}
	
	@Override
	public TileEntity createNewTileEntity(World worldIn, int meta) {
		return new TileEntityBasic();
	}	
	
	@Override
	public boolean processInteract(EntityPlayer player, EnumHand hand)
    {
		if (!this.world.isRemote)
		{			
			System.out.println("Player has interacted with the mob");	
			player.openGui(TestModHandler.instance, GuiHandler.BASIC, world, (int) player.posX, (int)player.posY, (int)player.posZ);	
		}
		else
		{
			
			//player.openGui(ClowcadiaMod.modInstance, 0, this.world, (int) player.posX, (int)player.posY, (int)player.posZ);
		}
		return true;
    }




}

TileEntityBasic

package com.clowcadia.test.tileentities;

import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemStackHandler;

public class TileEntityBasic extends TileEntity implements ICapabilityProvider{
	
	private ItemStackHandler handler;
	
	public TileEntityBasic(){
		this.handler = new ItemStackHandler(9);  
	}
	
	@Override
	public void readFromNBT(NBTTagCompound compound) {
		this.handler.deserializeNBT(compound.getCompoundTag("ItemStackHandler"));
		super.readFromNBT(compound);
	}
	
	@Override
	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
		compound.setTag("ItemStackHandler", this.handler.serializeNBT());
		return super.writeToNBT(compound);
	}
	
	@Override
	public SPacketUpdateTileEntity getUpdatePacket() {
		NBTTagCompound compound = new NBTTagCompound();
		this.writeToNBT(compound);
		int metadata = getBlockMetadata();
		return new SPacketUpdateTileEntity(this.pos, metadata, compound);
	}

	@Override
	public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
		this.readFromNBT(pkt.getNbtCompound());
	}

	@Override
	public NBTTagCompound getUpdateTag() {
		NBTTagCompound compound = new NBTTagCompound();
		this.writeToNBT(compound);
		return compound;
	}
	
	@Override
	public void handleUpdateTag(NBTTagCompound tag) {
		this.readFromNBT(tag);
	}

	@Override
	public NBTTagCompound getTileData() {
		NBTTagCompound compound = new NBTTagCompound();
		this.writeToNBT(compound);
		return compound;
	}
	
	@Override
	public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
		if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return (T) this.handler;
		return super.getCapability(capability, facing);
	}
	
	@Override
	public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
		if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return true;
		return super.hasCapability(capability, facing);
	}
	
	@Override
	public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) {
		return false;
	}

}

ContainerBasic

package com.clowcadia.test.containers;

import com.clowcadia.test.tileentities.TileEntityBasic;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;

public class ContainerBasic extends Container{

	private TileEntityBasic te;
	
	public ContainerBasic(IInventory playerInv, TileEntityBasic te) {
		
		this.te=te;
		IItemHandler handler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); //Gets the inventory from our tile entity

		//Our tile entity slots
		this.addSlotToContainer(new SlotItemHandler(handler, 0, 62, 17));
		this.addSlotToContainer(new SlotItemHandler(handler, 1, 80, 17));
		this.addSlotToContainer(new SlotItemHandler(handler, 2, 98, 17));
		this.addSlotToContainer(new SlotItemHandler(handler, 3, 62, 35));
		this.addSlotToContainer(new SlotItemHandler(handler, 4, 80, 35));
		this.addSlotToContainer(new SlotItemHandler(handler, 5, 98, 35));
		this.addSlotToContainer(new SlotItemHandler(handler, 6, 62, 53));
		this.addSlotToContainer(new SlotItemHandler(handler, 7, 80, 53));
		this.addSlotToContainer(new SlotItemHandler(handler, 8, 98, 53));
		
	//The player's inventory slots
		int xPos = 8; //The x position of the top left player inventory slot on our texture
		int yPos = 84; //The y position of the top left player inventory slot on our texture

		//Player slots
		for (int y = 0; y < 3; ++y) {
			for (int x = 0; x < 9; ++x) {
				this.addSlotToContainer(new Slot(playerInv, x + y * 9 + 9, xPos + x * 18, yPos + y * 18));
			}
		}

		for (int x = 0; x < 9; ++x) {
			this.addSlotToContainer(new Slot(playerInv, x, xPos + x * 18, yPos + 58));
		}
	}
	
	@Override
	public boolean canInteractWith(EntityPlayer player) {
		return !player.isSpectator();
	}
}

GuiHandler

package com.clowcadia.test;


import java.security.PublicKey;

import com.clowcadia.test.containers.ContainerBasic;
import com.clowcadia.test.gui.GuiBasic;
import com.clowcadia.test.tileentities.TileEntityBasic;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

public class GuiHandler implements IGuiHandler{
	
	public static final int BASIC = 0;

	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if(ID==BASIC){
			return new ContainerBasic(player.inventory, (TileEntityBasic) world.getTileEntity(new BlockPos(x,y,z)));
		}
		return null;
	}

	@Override
	public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if(ID==BASIC){
			return new GuiBasic(player.inventory, (TileEntityBasic) world.getTileEntity(new BlockPos(x,y,z)));
		}
		return null;
	}

}

GuiBasic

package com.clowcadia.test.gui;

import java.util.ArrayList;
import java.util.List;

import com.clowcadia.test.containers.ContainerBasic;
import com.clowcadia.test.tileentities.TileEntityBasic;
import com.clowcadia.tutorial3.Reference;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.items.CapabilityItemHandler;

public class GuiBasic extends GuiContainer{
	
	private TileEntityBasic te;
	private IInventory playerInv;

	public GuiBasic(IInventory playerInv, TileEntityBasic te) {
		super(new ContainerBasic(playerInv, te));
		
		this.xSize=176;
		this.ySize=166;
		
		this.playerInv = playerInv;
		this.te = te;		
	}

	@Override
	protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
		GlStateManager.color(1.0F, 1.0F, 1.0F,1.0F);
		this.mc.getTextureManager().bindTexture(new ResourceLocation(Reference.MODID, "textures/gui/container/basic.png"));
		this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize,this.ySize);
		
	}
	
	/**
	 * Draws the text that is an overlay, i.e where it says Block Breaker in the gui on the top
	 */
	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		String s = I18n.format("container.basic"); //Gets the formatted name for the block breaker from the language file
		this.mc.fontRendererObj.drawString(s, this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //Draws the block breaker name in the center on the top of the gui
		this.mc.fontRendererObj.drawString(this.playerInv.getDisplayName().getFormattedText(), 8, 72, 4210752); //The player's inventory name
		int actualMouseX = mouseX - ((this.width - this.xSize) / 2);
		int actualMouseY = mouseY - ((this.height - this.ySize) / 2);
		if(actualMouseX >= 134 && actualMouseX <= 149 && actualMouseY >= 17 && actualMouseY <= 32 && te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).getStackInSlot(9) == ItemStack.EMPTY) {
			List<String> text = new ArrayList<String>();
			text.add(TextFormatting.GRAY + I18n.format("gui.basic.enchanted_book.tooltip"));
			this.drawHoveringText(text, actualMouseX, actualMouseY);
		}
	}

}

Error report

Quote

2017-02-25 20:36:27,884 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2017-02-25 20:36:27,886 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[20:36:27] [main/INFO] [GradleStart]: Extra: []
[20:36:28] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Andre/.gradle/caches/minecraft/assets, --assetIndex, 1.11, --accessToken{REDACTED}, --version, 1.11.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[20:36:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[20:36:28] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[20:36:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[20:36:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[20:36:28] [main/INFO] [FML]: Forge Mod Loader version 13.20.0.2228 for Minecraft 1.11.2 loading
[20:36:28] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_121, running on Windows 10:amd64:10.0, installed at C:\Program Files\JDK
[20:36:28] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[20:36:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[20:36:28] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[20:36:28] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[20:36:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[20:36:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[20:36:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[20:36:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[20:36:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[20:36:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[20:36:28] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[20:36:30] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[20:36:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[20:36:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[20:36:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[20:36:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[20:36:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[20:36:31] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
2017-02-25 20:36:31,958 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2017-02-25 20:36:31,994 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2017-02-25 20:36:31,996 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[20:36:32] [Client thread/INFO]: Setting user: Player819
[20:36:38] [Client thread/WARN]: Skipping bad option: lastServer:
[20:36:38] [Client thread/INFO]: LWJGL Version: 2.9.4
[20:36:39] [Client thread/INFO]: [STDOUT]: ---- Minecraft Crash Report ----
// I just don't know what went wrong :(

Time: 2/25/17 8:36 PM
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


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

-- System Details --
Details:
	Minecraft Version: 1.11.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_121, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 779535904 bytes (743 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 369.09' Renderer: 'GeForce 920MX/PCIe/SSE2'
[20:36:39] [Client thread/INFO] [FML]: MinecraftForge v13.20.0.2228 Initialized
[20:36:39] [Client thread/INFO] [FML]: Replaced 232 ore recipes
[20:36:40] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[20:36:40] [Client thread/INFO] [FML]: Searching C:\Users\Andre\OneDrive\Documents\forge\1.11\run\mods for mods
[20:36:41] [Client thread/INFO] [FML]: Forge Mod Loader has identified 8 mods to load
[20:36:42] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, testmod, tutorial, tutorial2, tutorial3] at CLIENT
[20:36:42] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, testmod, tutorial, tutorial2, tutorial3] at SERVER
[20:36:43] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Test Mod, FMLFileResourcePack:Tutorial Mod, FMLFileResourcePack:Tutorial Mod 2, FMLFileResourcePack:Tutorial Mod 3
[20:36:43] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[20:36:43] [Client thread/INFO] [FML]: Found 444 ObjectHolder annotations
[20:36:43] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[20:36:43] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[20:36:43] [Client thread/INFO] [FML]: Applying holder lookups
[20:36:43] [Client thread/INFO] [FML]: Holder lookups applied
[20:36:43] [Client thread/INFO] [FML]: Applying holder lookups
[20:36:43] [Client thread/INFO] [FML]: Holder lookups applied
[20:36:43] [Client thread/INFO] [FML]: Applying holder lookups
[20:36:43] [Client thread/INFO] [FML]: Holder lookups applied
[20:36:43] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[20:36:43] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[20:36:43] [Client thread/INFO]: [STDOUT]: Tutorial Mod 2 is loading!
[20:36:43] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Found status: UP_TO_DATE Target: null
[20:36:43] [Client thread/INFO] [tutorial3]: PreInit
[20:36:43] [Client thread/INFO] [tutorial3]: Registered Block: tin_ore
[20:36:43] [Client thread/INFO] [tutorial3]: Registered Block: block_breaker
[20:36:43] [Client thread/INFO] [tutorial3]: Registered Item: chip
[20:36:43] [Client thread/INFO] [tutorial3]: Registered Render For tin_ore
[20:36:43] [Client thread/INFO] [tutorial3]: Registered Render For block_breaker
[20:36:43] [Client thread/INFO] [tutorial3]: Registered Render For block_breaker
[20:36:43] [Client thread/INFO] [tutorial3]: Registered Render For chip
[20:36:43] [Client thread/INFO] [tutorial3]: Registered Render For chip
[20:36:43] [Client thread/INFO] [FML]: Applying holder lookups
[20:36:43] [Client thread/INFO] [FML]: Holder lookups applied
[20:36:43] [Client thread/INFO] [FML]: Injecting itemstacks
[20:36:43] [Client thread/INFO] [FML]: Itemstack injection complete
[20:36:48] [Sound Library Loader/INFO]: Starting up SoundSystem...
[20:36:48] [Thread-8/INFO]: Initializing LWJGL OpenAL
[20:36:48] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[20:36:48] [Thread-8/INFO]: OpenAL initialized.
[20:36:48] [Sound Library Loader/INFO]: Sound engine started
[20:36:55] [Client thread/INFO] [FML]: Max texture size: 16384
[20:36:55] [Client thread/INFO]: Created: 16x16 textures-atlas
[20:36:55] [Client thread/ERROR] [FML]: Exception loading model for variant tutorial2:counter#inventory for item "tutorial2:counter", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tutorial2:item/counter with loader VanillaLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:336) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:156) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.io.FileNotFoundException: tutorial2:models/item/counter.json
	at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:69) ~[FallbackResourceManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:65) ~[SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:334) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.access$1600(ModelLoader.java:126) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:937) ~[ModelLoader$VanillaLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 20 more
[20:36:55] [Client thread/ERROR] [FML]: Exception loading model for variant tutorial2:counter#inventory for item "tutorial2:counter", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tutorial2:counter#inventory with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:344) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:156) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1253) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 20 more
[20:36:55] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant tutorial2:counter#inventory: 
java.lang.Exception: Could not load model definition for variant tutorial2:counter
	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:293) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:121) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:248) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:155) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model tutorial2:blockstates/counter.json
	at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:228) ~[ModelBakery.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:289) ~[ModelLoader.class:?]
	... 20 more
Caused by: java.io.FileNotFoundException: tutorial2:blockstates/counter.json
	at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:104) ~[FallbackResourceManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:79) ~[SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:221) ~[ModelBakery.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:289) ~[ModelLoader.class:?]
	... 20 more
[20:36:55] [Client thread/ERROR] [FML]: Exception loading model for variant tutorial2:counter#normal for blockstate "tutorial2:counter"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tutorial2:counter#normal with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:260) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:248) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:155) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1253) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 21 more
[20:36:56] [Client thread/INFO] [tutorial3]: Init
[20:36:56] [Client thread/INFO] [FML]: Injecting itemstacks
[20:36:56] [Client thread/INFO] [FML]: Itemstack injection complete
[20:36:56] [Client thread/INFO] [tutorial3]: PostInit
[20:36:56] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 8 mods
[20:36:56] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Test Mod, FMLFileResourcePack:Tutorial Mod, FMLFileResourcePack:Tutorial Mod 2, FMLFileResourcePack:Tutorial Mod 3
[20:37:00] [Client thread/INFO]: SoundSystem shutting down...
[20:37:00] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[20:37:00] [Sound Library Loader/INFO]: Starting up SoundSystem...
[20:37:00] [Thread-10/INFO]: Initializing LWJGL OpenAL
[20:37:00] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[20:37:00] [Thread-10/INFO]: OpenAL initialized.
[20:37:00] [Sound Library Loader/INFO]: Sound engine started
[20:37:05] [Client thread/INFO] [FML]: Max texture size: 16384
[20:37:05] [Client thread/INFO]: Created: 512x512 textures-atlas
[20:37:07] [Client thread/WARN]: Skipping bad option: lastServer:
[20:37:08] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[20:37:52] [Server thread/INFO]: Starting integrated minecraft server version 1.11.2
[20:37:52] [Server thread/INFO]: Generating keypair
[20:37:52] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[20:37:52] [Server thread/INFO] [FML]: Found a missing id from the world tutorial2:pedestal3
[20:37:52] [Server thread/INFO] [FML]: Applying holder lookups
[20:37:52] [Server thread/INFO] [FML]: Holder lookups applied
[20:37:53] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@62830ef2)
[20:37:53] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@62830ef2)
[20:37:53] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@62830ef2)
[20:37:53] [Server thread/INFO]: Preparing start region for level 0
[20:37:54] [Server thread/INFO]: Changing view distance to 12, from 10
[20:37:55] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[20:37:55] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[20:37:55] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 8 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]_a
[20:37:55] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[20:37:55] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[20:37:55] [Server thread/INFO]: Player819[local:E:b113bef9] logged in with entity id 223 at (9.600334153640427, 71.0, -158.39731805764194)
[20:37:55] [Server thread/INFO]: Player819 joined the game
[20:37:57] [Server thread/INFO]: Saving and pausing game...
[20:37:57] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
[20:37:57] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
[20:37:57] [Server thread/INFO]: Saving chunks for level 'New World'/The End
[20:37:58] [Server thread/INFO]: Saving and pausing game...
[20:37:58] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
[20:37:58] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@2fb933d8[id=00bb7f76-47ca-3891-96fe-03177d2fac78,name=Player819,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
	at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?]
	at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3056) [Minecraft.class:?]
	at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [SkinManager$3.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_121]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
[20:37:58] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
[20:37:58] [Server thread/INFO]: Saving chunks for level 'New World'/The End

 

 

Edited by clowcadia
Posted
Just now, clowcadia said:

So are you saying put tileentitybasic code inside basic?

Specifically the hasCapability getCapability the IItemModifiable field, and you will want the readFrom/writeToNBT methods.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

Ok still nothing, I dissabled the tile entity that i created extra and moved some code and get this error

[23:09:58] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_121]
	at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.util.Util.runTask(Util.java:27) [Util.class:?]
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:753) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698) [MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [IntegratedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547) [MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
Caused by: java.lang.NullPointerException
	at com.clowcadia.test.containers.ContainerBasic.<init>(ContainerBasic.java:20) ~[ContainerBasic.class:?]
	at com.clowcadia.test.GuiHandler.getServerGuiElement(GuiHandler.java:22) ~[GuiHandler.class:?]
	at net.minecraftforge.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:254) ~[NetworkRegistry.class:?]
	at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:89) ~[FMLNetworkHandler.class:?]
	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2733) ~[EntityPlayer.class:?]
	at com.clowcadia.test.npc.Basic.processInteract(Basic.java:83) ~[Basic.class:?]
	at net.minecraft.entity.EntityLiving.processInitialInteract(EntityLiving.java:1337) ~[EntityLiving.class:?]
	at net.minecraft.entity.player.EntityPlayer.interactOn(EntityPlayer.java:1273) ~[EntityPlayer.class:?]
	at net.minecraft.network.NetHandlerPlayServer.processUseEntity(NetHandlerPlayServer.java:1067) ~[NetHandlerPlayServer.class:?]
	at net.minecraft.network.play.client.CPacketUseEntity.processPacket(CPacketUseEntity.java:94) ~[CPacketUseEntity.class:?]
	at net.minecraft.network.play.client.CPacketUseEntity.processPacket(CPacketUseEntity.java:15) ~[CPacketUseEntity.class:?]
	at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_121]
	at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.util.Util.runTask(Util.java:26) ~[Util.class:?]
	... 5 more

The updated Basic

package com.clowcadia.test.npc;

import com.clowcadia.test.GuiHandler;
import com.clowcadia.test.TestModHandler;
import com.clowcadia.test.tileentities.TileEntityBasic;

import net.minecraft.block.ITileEntityProvider;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemStackHandler;

public class Basic extends EntityLiving implements  ICapabilityProvider{
	
	private ItemStackHandler handler;
	
	public Basic(World world) 
	{			
		super(world);
		this.handler = new ItemStackHandler(9); 
	}
	
	@Override
	public void readFromNBT(NBTTagCompound compound) {
		this.handler.deserializeNBT(compound.getCompoundTag("ItemStackHandler"));
		super.readFromNBT(compound);
	}
	
	@Override
	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
		compound.setTag("ItemStackHandler", this.handler.serializeNBT());
		return super.writeToNBT(compound);
	}	

	public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
		this.readFromNBT(pkt.getNbtCompound());
	}

	public NBTTagCompound getUpdateTag() {
		NBTTagCompound compound = new NBTTagCompound();
		this.writeToNBT(compound);
		return compound;
	}
	
	public void handleUpdateTag(NBTTagCompound tag) {
		this.readFromNBT(tag);
	}

	public NBTTagCompound getTileData() {
		NBTTagCompound compound = new NBTTagCompound();
		this.writeToNBT(compound);
		return compound;
	}
	
	@Override
	public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
		if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return (T) this.handler;
		return super.getCapability(capability, facing);
	}
	
	@Override
	public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
		if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return true;
		return super.hasCapability(capability, facing);
	}
	
	
	@Override
	public boolean processInteract(EntityPlayer player, EnumHand hand)
    {
		if (!this.world.isRemote)
		{			
			System.out.println("Player has interacted with the mob");	
			player.openGui(TestModHandler.instance, GuiHandler.BASIC, this.world, (int) player.posX, (int)player.posY, (int)player.posZ);	
		}
		else
		{
			
			//player.openGui(ClowcadiaMod.modInstance, 0, this.world, (int) player.posX, (int)player.posY, (int)player.posZ);
		}
		return true;
    }




}

 

Posted
17 minutes ago, clowcadia said:

at com.clowcadia.test.containers.ContainerBasic.<init>(ContainerBasic.java:20) ~[ContainerBasic.class:?]

Look! Post your ContainerBasic and GUIHandler classes please

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted
package com.clowcadia.test.containers;

import com.clowcadia.test.npc.Basic;
import com.clowcadia.test.tileentities.TileEntityBasic;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;

public class ContainerBasic extends Container{

	private Basic te;
	
	public ContainerBasic(IInventory playerInv, Basic te) {
		
		this.te=te;
		IItemHandler handler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); //Gets the inventory from our tile entity

		//Our tile entity slots
		this.addSlotToContainer(new SlotItemHandler(handler, 0, 62, 17));
		this.addSlotToContainer(new SlotItemHandler(handler, 1, 80, 17));
		this.addSlotToContainer(new SlotItemHandler(handler, 2, 98, 17));
		this.addSlotToContainer(new SlotItemHandler(handler, 3, 62, 35));
		this.addSlotToContainer(new SlotItemHandler(handler, 4, 80, 35));
		this.addSlotToContainer(new SlotItemHandler(handler, 5, 98, 35));
		this.addSlotToContainer(new SlotItemHandler(handler, 6, 62, 53));
		this.addSlotToContainer(new SlotItemHandler(handler, 7, 80, 53));
		this.addSlotToContainer(new SlotItemHandler(handler, 8, 98, 53));
		
	//The player's inventory slots
		int xPos = 8; //The x position of the top left player inventory slot on our texture
		int yPos = 84; //The y position of the top left player inventory slot on our texture

		//Player slots
		for (int y = 0; y < 3; ++y) {
			for (int x = 0; x < 9; ++x) {
				this.addSlotToContainer(new Slot(playerInv, x + y * 9 + 9, xPos + x * 18, yPos + y * 18));
			}
		}

		for (int x = 0; x < 9; ++x) {
			this.addSlotToContainer(new Slot(playerInv, x, xPos + x * 18, yPos + 58));
		}
	}
	
	@Override
	public boolean canInteractWith(EntityPlayer player) {
		return !player.isSpectator();
	}
}
package com.clowcadia.test;


import java.security.PublicKey;

import com.clowcadia.test.containers.ContainerBasic;
import com.clowcadia.test.gui.GuiBasic;
import com.clowcadia.test.npc.Basic;
import com.clowcadia.test.tileentities.TileEntityBasic;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

public class GuiHandler implements IGuiHandler{
	
	public static final int BASIC = 0;
	private Basic te;

	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if(ID==BASIC){
			return new ContainerBasic(player.inventory, te);
		}
		return null;
	}

	@Override
	public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if(ID==BASIC){
			return new GuiBasic(player.inventory, te);
		}
		return null;
	}

}

 

Posted

You cant just declare a variable and expect it to not be null. Your te field in your GuiHandler is never initialized so you need to get the Entity somehow. Maybe using some raytracing?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
5 minutes ago, diesieben07 said:

You need to pass the entity ID (Entity::getEntityId) to the gui handler using the x, y or z parameter. Then use World::getEntityByID to get the entity back from the ID. 

Is this not passing it

player.openGui(TestModHandler.instance, GuiHandler.BASIC, this.world, (int) player.posX, (int)player.posY, (int)player.posZ);

and getting the it

public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if(ID==BASIC){

 

Posted

Hows this GuiHandler

	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if(ID==BASIC){
			return new ContainerBasic(player.inventory, ID, world);
		}
		return null;
	}

	@Override
	public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if(ID==BASIC){
			return new GuiBasic(player.inventory, ID, world);
		}
		return null;
	}

Container Basic

public ContainerBasic(IInventory playerInv, int ID, World world) {
		
		//World world;
		Entity basic = world.getEntityByID(ID);
		IItemHandler handler = basic.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); //Gets the inventory from our tile entity

Gui Basic

public class GuiBasic extends GuiContainer{
	
	private IInventory playerInv;

	public GuiBasic(IInventory playerInv, int ID, World world) {
		super(new ContainerBasic(playerInv, ID, world));

still doesnt work with errors

Posted

OK in your ENTITY class, call get EntityID. Get the ID in the GUI HANDLER. 

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

Like this

@Override
	public boolean processInteract(EntityPlayer player, EnumHand hand)
    {
		
		if (!this.world.isRemote)
		{			
			basicID = this.getEntityId();
	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if(ID==BASIC){
			int basicID = Basic.basicID;

 

Posted

SO i think i did what i needed to do but the game crashed before it even launched

 my changes were

@Override
	public boolean processInteract(EntityPlayer player, EnumHand hand)
    {
		
		if (!this.world.isRemote)
		{			
			basicID = this.getEntityId();
			System.out.println("Player has interacted with the mob");	
			player.openGui(TestModHandler.instance, GuiHandler.BASIC, this.world, (int) player.posX, (int)player.posY, (int)player.posZ);	
		}
		else
		{
			
			//player.openGui(ClowcadiaMod.modInstance, 0, this.world, (int) player.posX, (int)player.posY, (int)player.posZ);
		}
		return true;
    }
	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if(ID==BASIC){
			int basicID = Basic.basicID;
			Entity basic = world.getEntityByID(basicID);
			
			return new ContainerBasic(player.inventory,basic);
		}
		return null;
	}
public class ContainerBasic extends Container{
	public Entity entity;
	
	public ContainerBasic(IInventory playerInv, Entity entity) {
		this.entity = entity;
		
		IItemHandler handler = entity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); //Gets the inventory from our tile entity
2017-02-26 20:44:28,664 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2017-02-26 20:44:28,666 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[20:44:28] [main/INFO] [GradleStart]: Extra: []
[20:44:28] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Andre/.gradle/caches/minecraft/assets, --assetIndex, 1.11, --accessToken{REDACTED}, --version, 1.11.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[20:44:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[20:44:28] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[20:44:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[20:44:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[20:44:28] [main/INFO] [FML]: Forge Mod Loader version 13.20.0.2228 for Minecraft 1.11.2 loading
[20:44:28] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_121, running on Windows 10:amd64:10.0, installed at C:\Program Files\JDK
[20:44:28] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[20:44:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[20:44:28] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[20:44:28] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[20:44:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[20:44:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[20:44:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[20:44:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[20:44:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[20:44:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[20:44:29] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[20:44:31] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[20:44:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[20:44:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[20:44:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[20:44:32] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[20:44:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[20:44:32] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
2017-02-26 20:44:33,005 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2017-02-26 20:44:33,060 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2017-02-26 20:44:33,063 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[20:44:33] [Client thread/INFO]: Setting user: Player916
[20:44:40] [Client thread/WARN]: Skipping bad option: lastServer:
[20:44:40] [Client thread/INFO]: LWJGL Version: 2.9.4
[20:44:41] [Client thread/INFO]: [STDOUT]: ---- Minecraft Crash Report ----
// This doesn't make any sense!

Time: 2/26/17 8:44 PM
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


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

-- System Details --
Details:
	Minecraft Version: 1.11.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_121, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 794147544 bytes (757 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 369.09' Renderer: 'GeForce 920MX/PCIe/SSE2'
[20:44:41] [Client thread/INFO] [FML]: MinecraftForge v13.20.0.2228 Initialized
[20:44:41] [Client thread/INFO] [FML]: Replaced 232 ore recipes
[20:44:42] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[20:44:42] [Client thread/INFO] [FML]: Searching C:\Users\Andre\OneDrive\Documents\forge\1.11\run\mods for mods
[20:44:44] [Client thread/INFO] [FML]: Forge Mod Loader has identified 8 mods to load
[20:44:44] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, testmod, tutorial, tutorial2, tutorial3] at CLIENT
[20:44:44] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, testmod, tutorial, tutorial2, tutorial3] at SERVER
[20:44:45] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Test Mod, FMLFileResourcePack:Tutorial Mod, FMLFileResourcePack:Tutorial Mod 2, FMLFileResourcePack:Tutorial Mod 3
[20:44:45] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[20:44:45] [Client thread/INFO] [FML]: Found 444 ObjectHolder annotations
[20:44:45] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[20:44:45] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[20:44:45] [Client thread/INFO] [FML]: Applying holder lookups
[20:44:45] [Client thread/INFO] [FML]: Holder lookups applied
[20:44:45] [Client thread/INFO] [FML]: Applying holder lookups
[20:44:45] [Client thread/INFO] [FML]: Holder lookups applied
[20:44:45] [Client thread/INFO] [FML]: Applying holder lookups
[20:44:45] [Client thread/INFO] [FML]: Holder lookups applied
[20:44:45] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[20:44:45] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[20:44:46] [Client thread/INFO]: [STDOUT]: Tutorial Mod 2 is loading!
[20:44:46] [Client thread/INFO] [tutorial3]: PreInit
[20:44:46] [Client thread/INFO] [tutorial3]: Registered Block: tin_ore
[20:44:46] [Client thread/INFO] [tutorial3]: Registered Block: block_breaker
[20:44:46] [Client thread/INFO] [tutorial3]: Registered Item: chip
[20:44:46] [Client thread/INFO] [tutorial3]: Registered Render For tin_ore
[20:44:46] [Client thread/INFO] [tutorial3]: Registered Render For block_breaker
[20:44:46] [Client thread/INFO] [tutorial3]: Registered Render For block_breaker
[20:44:46] [Client thread/INFO] [tutorial3]: Registered Render For chip
[20:44:46] [Client thread/INFO] [tutorial3]: Registered Render For chip
[20:44:46] [Client thread/INFO] [FML]: Applying holder lookups
[20:44:46] [Client thread/INFO] [FML]: Holder lookups applied
[20:44:46] [Client thread/INFO] [FML]: Injecting itemstacks
[20:44:46] [Client thread/INFO] [FML]: Itemstack injection complete
[20:44:46] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue
[20:44:46] [Client thread/ERROR] [FML]: 
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCH	minecraft{1.11.2} [Minecraft] (minecraft.jar) 
	UCH	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCH	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2228.jar) 
	UCH	forge{13.20.0.2228} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2228.jar) 
	UCE	testmod{1.0.0} [Test Mod] (bin) 
	UCH	tutorial{1.0_a} [Tutorial Mod] (bin) 
	UCH	tutorial2{1.0.0} [Tutorial Mod 2] (bin) 
	UCH	tutorial3{0.0.1} [Tutorial Mod 3] (bin) 
[20:44:46] [Client thread/ERROR] [FML]: The following problems were captured during this phase
[20:44:46] [Client thread/ERROR] [FML]: Caught exception from Test Mod (testmod)
java.lang.RuntimeException: Invalid class class com.clowcadia.test.npc.Basic no constructor taking net.minecraft.world.World
	at net.minecraftforge.fml.common.registry.EntityEntry.init(EntityEntry.java:55) ~[forgeSrc-1.11.2-13.20.0.2228.jar:?]
	at net.minecraftforge.fml.common.registry.EntityEntry.<init>(EntityEntry.java:43) ~[forgeSrc-1.11.2-13.20.0.2228.jar:?]
	at net.minecraftforge.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:183) ~[forgeSrc-1.11.2-13.20.0.2228.jar:?]
	at net.minecraftforge.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:170) ~[forgeSrc-1.11.2-13.20.0.2228.jar:?]
	at com.clowcadia.test.NPCHandler.registerNPCs(NPCHandler.java:11) ~[bin/:?]
	at com.clowcadia.test.TestModHandler.preInit(TestModHandler.java:24) ~[bin/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:643) ~[forgeSrc-1.11.2-13.20.0.2228.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:246) ~[forgeSrc-1.11.2-13.20.0.2228.jar:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:224) ~[forgeSrc-1.11.2-13.20.0.2228.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147) [LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:628) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:268) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:478) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
[20:44:46] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Found status: UP_TO_DATE Target: null
[20:44:46] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: ---- Minecraft Crash Report ----
// Why is it breaking :(

Time: 2/26/17 8:44 PM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Test Mod (testmod)
Caused by: java.lang.RuntimeException: Invalid class class com.clowcadia.test.npc.Basic no constructor taking net.minecraft.world.World
	at net.minecraftforge.fml.common.registry.EntityEntry.init(EntityEntry.java:55)
	at net.minecraftforge.fml.common.registry.EntityEntry.<init>(EntityEntry.java:43)
	at net.minecraftforge.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:183)
	at net.minecraftforge.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:170)
	at com.clowcadia.test.NPCHandler.registerNPCs(NPCHandler.java:11)
	at com.clowcadia.test.TestModHandler.preInit(TestModHandler.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:643)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
	at com.google.common.eventbus.EventBus.post(EventBus.java:275)
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:246)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:224)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
	at com.google.common.eventbus.EventBus.post(EventBus.java:275)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147)
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:628)
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:268)
	at net.minecraft.client.Minecraft.init(Minecraft.java:478)
	at net.minecraft.client.Minecraft.run(Minecraft.java:387)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)


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

-- System Details --
Details:
	Minecraft Version: 1.11.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_121, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 836561136 bytes (797 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.38 Powered by Forge 13.20.0.2228 8 mods loaded, 8 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.11.2} [Minecraft] (minecraft.jar) 
	UCH	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCH	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2228.jar) 
	UCH	forge{13.20.0.2228} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2228.jar) 
	UCE	testmod{1.0.0} [Test Mod] (bin) 
	UCH	tutorial{1.0_a} [Tutorial Mod] (bin) 
	UCH	tutorial2{1.0.0} [Tutorial Mod 2] (bin) 
	UCH	tutorial3{0.0.1} [Tutorial Mod 3] (bin) 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 369.09' Renderer: 'GeForce 920MX/PCIe/SSE2'
[20:44:46] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Andre\OneDrive\Documents\forge\1.11\run\.\crash-reports\crash-2017-02-26_20.44.46-client.txt
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
package com.clowcadia.test;

import com.clowcadia.test.npc.Basic;

import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.EntityRegistry;

public class NPCHandler {
	
	public static void registerNPCs(){
		EntityRegistry.registerModEntity(new ResourceLocation(TestModHandler.modId,"basicNPC"), Basic.class, "BasicNPC", 
				0, TestModHandler.instance, 64, 1, true, 0x4286f4, 0x606e84);
	}

}

 

Posted

What you need to do is in your processInteract method when you call openGui instead of passing an x position you should pass getEntityID(). Then when you construct your Container and Gui pass World#getEntityBy/FromID(x)

  • Like 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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



×
×
  • Create New...

Important Information

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