![](https://forums.minecraftforge.net/uploads/set_resources_2/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
clowcadia
-
Posts
458 -
Joined
-
Last visited
Posts posted by clowcadia
-
-
Maybe getCompoundTag? getTag?
-
Just now, diesieben07 said:
If compound doesn't have an entry called "Stomach", it will return 0. Meaning you will set this.stomach to 0.
Thank you for clarification, as for the hasTag method, i cant seem to find it in NBTTagCompound class
-
15 hours ago, Animefan8888 said:
When the world is loaded TE's have readFromNBT called and if the tag doesn't exist then it will return a default value for numbers that is 0. And then when the world will call writeToNBT at certain points and then save the tag making it exist, but it will be set to 0 because it was read as 0. So to check if the tag is there use NBTTagCompound#hasTag(String)
what i dont understand is why
@Override public void readEntityFromNBT(NBTTagCompound compound) { Utils.getLogger().info("basic readNBT " +this.stomach); this.handler.deserializeNBT(compound.getCompoundTag("ItemStackHandler")); this.stomach = compound.getInteger("Stomach");
why it does this
[16:28:51] [Server thread/INFO] [testmod]: basic readNBT 800 [16:28:51] [Server thread/INFO]: Preparing spawn area: 56% [16:28:52] [Server thread/INFO] [testmod]: 0 800
when
@Override public void onEntityUpdate() { if (this.world != null){ if(!this.world.isRemote){ if(stomach != stomachCap)Utils.getLogger().info(this.stomach+" "+stomachCap); } } super.onEntityUpdate(); }
-
did not see the post above
How does one set an NTB tag, i am having a hard time understanding thigns through my research . my findings are itemstack specific
-
is "Stomach" not the tag compound.setInteger("Stomach", this.stomach);
-
Is get/setInteger not the tag setting?
-
I dont i undestand what to do about it
-
when i initilize the value it is 800 but then when the update method goes on it becomes 0, how can i have the value to stay at 800 rather being 0, where should i modify code and what should i do, call the write nbt there or?
-
so how do i get it update to its original value
-
yes, the entity apears and everything just the that initial 800 turns to 0 after being initilized
-
package com.clowcadia.test.npc; import com.clowcadia.test.GuiHandler; import com.clowcadia.test.TestModHandler; import com.clowcadia.test.utils.Utils; 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 static Basic instance; public static int basicID; private int stomach=800; private int stomachCap = 800; public Basic(World world) { super(world); this.handler = new ItemStackHandler(9); Utils.getLogger().info("basic constructor" +this.stomach); } @Override public void readEntityFromNBT(NBTTagCompound compound) { this.handler.deserializeNBT(compound.getCompoundTag("ItemStackHandler")); this.stomach = compound.getInteger("Stomach"); super.readEntityFromNBT(compound); } @Override public void writeEntityToNBT(NBTTagCompound compound) { super.writeEntityToNBT(compound); compound.setTag("ItemStackHandler", this.handler.serializeNBT()); compound.setInteger("Stomach", this.stomach); } public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { this.readEntityFromNBT(pkt.getNbtCompound()); } public NBTTagCompound getUpdateTag() { NBTTagCompound compound = new NBTTagCompound(); this.writeEntityToNBT(compound); return compound; } public void handleUpdateTag(NBTTagCompound tag) { this.readEntityFromNBT(tag); } public NBTTagCompound getTileData() { NBTTagCompound compound = new NBTTagCompound(); this.writeEntityToNBT(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); } public boolean isUseableByPlayer(EntityPlayer player) { return true; } @Override public void onEntityUpdate() { if (this.world != null){ if(!this.world.isRemote){ if(stomach != stomachCap)Utils.getLogger().info(this.stomach+" "+stomachCap); } } super.onEntityUpdate(); } @Override public boolean processInteract(EntityPlayer player, EnumHand hand) { if (!this.world.isRemote) { basicID = this.getEntityId(); //for inputing into x/y/z in the opne gui to pass the entety id System.out.println("Player has interacted with the mob"); player.openGui(TestModHandler.instance, GuiHandler.BASIC, this.world, basicID, (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; } }
-
Write/ReadEniityToNBT methods still dont work
-
7 hours ago, Choonster said:
I completely missed the fact that this is an Entity rather than a TileEntity.
Still, overriding Entity#readFromNBT and Entity#writeToNBT should work (though you're meant to override Entity#readEntityFromNBT and Entity#writeEntityToNBT instead).
thank you.. whats going on lol
-
[23:52:12] [Server thread/INFO] [testmod]: basic constructor800 [23:52:13] [Server thread/INFO]: Preparing spawn area: 87% [23:52:13] [Server thread/INFO] [testmod]: 0 800
-
package com.clowcadia.test.npc; import com.clowcadia.test.GuiHandler; import com.clowcadia.test.TestModHandler; import com.clowcadia.test.utils.Utils; 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.util.math.BlockPos; 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; import scala.reflect.internal.Trees.This; public class Basic extends EntityLiving implements ICapabilityProvider{ private ItemStackHandler handler; public static Basic instance; public static int basicID; private int stomach=800; private int stomachCap = 800; public Basic(World world) { super(world); this.handler = new ItemStackHandler(9); Utils.getLogger().info("basic constructor" +this.stomach); } @Override public void readFromNBT(NBTTagCompound compound) { this.handler.deserializeNBT(compound.getCompoundTag("ItemStackHandler")); this.stomach = compound.getInteger("Stomach"); super.readFromNBT(compound); } @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { compound.setTag("ItemStackHandler", this.handler.serializeNBT()); compound.setInteger("Stomach", this.stomach); 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); } public boolean isUseableByPlayer(EntityPlayer player) { return true; } @Override public void onEntityUpdate() { if (this.world != null){ if(!this.world.isRemote){ if(stomach != stomachCap)Utils.getLogger().info(this.stomach+" "+stomachCap); } } super.onEntityUpdate(); } @Override public boolean processInteract(EntityPlayer player, EnumHand hand) { if (!this.world.isRemote) { basicID = this.getEntityId(); //for inputing into x/y/z in the opne gui to pass the entety id System.out.println("Player has interacted with the mob"); player.openGui(TestModHandler.instance, GuiHandler.BASIC, this.world, basicID, (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; } }
-
-
I have an integer value i add to nbt, i inticilize and declare it in the class main structure, but when nbt reads and write and my entity onUpdates it becomes 0
-
Hey guys, Id like to add Property to an Entity that diminishes every tick or so. I know I need to use capabilities, yet I have no idea what to do with a capability. I dont think i should expose a capability as there are no options for properties, should I use an existing one or create one? And if so where should i start, what is the sudo aproach to my delima?
-
7 minutes ago, Animefan8888 said:
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)
Thank you for clarifying something i had tough time understanding. this is very clear
-
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); } }
-
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;
-
How do i call getEntityId? where, in the entityLoving class... no idea what i am doing
-
Am i going to need another method to replace opengui?
-
Wish there was an example doing this
NBT integer var update wrong
in Modder Support
Posted
I do, i dont understand what your implying ? Maybe i can work on ur criticism