
Chasingu
Forge Modder-
Posts
13 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
Developer of MiscCraft
Chasingu's Achievements

Tree Puncher (2/8)
0
Reputation
-
[1.7.10] Custom Mob Falls/Gets Stuck in Block
Chasingu replied to Chasingu's topic in Modder Support
Adjusting the above code to use setSize doesn't seem to alleviate the problem. -
[1.7.10] Custom Mob Falls/Gets Stuck in Block
Chasingu replied to Chasingu's topic in Modder Support
So I skimmed through and changed my Entity file to look like this *I only took what I needed*: public EntityCustomMob(World world) { super(world); } protected void applyEntityAttributes(){ super.applyEntityAttributes(); this.setSize(0.9F, 1.3F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); } public boolean isAIEnabled() { return true; } @Override public EntityAgeable createChild(EntityAgeable p_90011_1_) { return null; } However, adding these lines of Code to my Entity Class now generates errors when I attempt to spawn it. [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.reflect.InvocationTargetException [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Constructor.newInstance(Unknown Source) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.entity.EntityList.createEntityByID(EntityList.java:221) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.item.ItemMonsterPlacer.spawnCreature(ItemMonsterPlacer.java:173) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.item.ItemMonsterPlacer.onItemUse(ItemMonsterPlacer.java:79) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:456) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:142) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:422) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: Caused by: java.lang.NullPointerException [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.misccraft.mod.entity.EntityCustomMob.applyEntityAttributes(EntityCustomMob.java:19) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:156) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:78) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.entity.EntityCreature.<init>(EntityCreature.java:36) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.entity.EntityAgeable.<init>(EntityAgeable.java:17) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.entity.passive.EntityAnimal.<init>(EntityAnimal.java:34) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.misccraft.mod.entity.EntityCustomMob.<init>(EntityCustomMob.java:12) [21:03:30] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: ... 20 more [21:03:30] [server thread/WARN]: Skipping Entity with id 3 -
[1.7.10] Custom Mob Falls/Gets Stuck in Block
Chasingu replied to Chasingu's topic in Modder Support
Here's the Entity File (Pretty Bare Bones): public EntityCustomMob(World world) { super(world); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); //this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); } @Override public EntityAgeable createChild(EntityAgeable p_90011_1_) { return null; } I disabled the movement speed because I thought that might have been causing it, but it appeared not to. -
Hello all! I have recently created a custom mob that is only around 3 pixel blocks high. When spawning the custom rendered mob, it appears for a brief second, turns black, and disappears. After searching for a while, if I dug up the block, it would fall out, and then fall into the block under it. Testing with a pillar, I was able to get this image after spamming F2 to capture it: https://i.imgur.com/FcESXoK.png To create this scenario, I placed the Spawn Egg on the Dirt Block off screen at the top. The mob falls like this until you break it, and then rinse and repeat until you get to bed rock where it then falls though the world. Any help would be appreciated! Thanks!
-
[SOLVED][1.7.10] Detect Neighboring Block Name
Chasingu replied to Chasingu's topic in Modder Support
Thank you for being patient with me. You have solved my question. Thanks again! -
[SOLVED][1.7.10] Detect Neighboring Block Name
Chasingu replied to Chasingu's topic in Modder Support
You said that onNeighborBlockChange is intended to work via re-checking your surroundings. I assumed this is done at the end of whatever you are processing. I don't get how what I want to do is not possible. Chest's do the same thing I'm trying to do, they detect a chest next to themselves, and alter their model accordingly. I'm new to the modding scene and not as experienced in Java as others, so when I look at the Chest/Fence/Pane source code, I see the code, but I don't understand what it is doing. I guess what I am trying to say is, how would I go about detecting a CERTAIN block when its placed next to my block? -
[SOLVED][1.7.10] Detect Neighboring Block Name
Chasingu replied to Chasingu's topic in Modder Support
So I take it onNeighborBlockChange is usually used last then. So what method would I use to get the block that was just placed? -
[SOLVED][1.7.10] Detect Neighboring Block Name
Chasingu replied to Chasingu's topic in Modder Support
package com.misccraft.mod.blocks; import com.misccraft.mod.Misccraft; import com.misccraft.mod.tileentity.TileEntityOfficeDesk; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class OfficeDesk extends BlockContainer { private int side; public OfficeDesk(Material material) { super(material); this.setHardness(1.0F); this.setResistance(5.0F); // To be changed this.setBlockBounds(0F, 0F, 0F, 1F, 0.8125F, 1F); // To be changed this.setCreativeTab(Misccraft.misccraftTab); } public int getRenderType() { return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World var1, int var2) { return new TileEntityOfficeDesk(); } @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityplayer, ItemStack itemstack) { if(entityplayer == null) { return; } TileEntityOfficeDesk perf = (TileEntityOfficeDesk)world.getTileEntity(x,y,z); perf.direction = MathHelper.floor_double((double)((entityplayer.rotationYaw*4F)/360F) + 0.5D) & 3; perf.side = 2; // Static for testing } public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { System.out.println(block.getLocalizedName()); // Test to check neighboring block. } } -
[SOLVED][1.7.10] Detect Neighboring Block Name
Chasingu replied to Chasingu's topic in Modder Support
I may have not understood your answer then. If you are saying to use onNeighborBlockChange, when I tried doing my tests, it wouldn't show the block I had placed until I removed it. For example, I had a table, and when I put a table next to it, the read out on the console said tile.block.air. It wasn't until I broke the table I put down that it returned, tile.block.table. -
[SOLVED][1.7.10] Detect Neighboring Block Name
Chasingu replied to Chasingu's topic in Modder Support
Alright, so what methods should I be implementing into what file? -
Hello all! I am building a mod that contains a 3D model "multiblock". Basically, its a table. But as you add more tables, it changes what model gets rendered to make it look connected. I know I am going to have to do something with onNeighborBlockChange() but when I do simple tests printing the block parameter, I'm getting what was there before I placed the block IE Air, not the block that was just added. So my question is, how would I go about detecting all four sides for a specific block? Thanks in advance.
-
[SOLVED][1.7.10] Saving Block Direction State
Chasingu replied to Chasingu's topic in Modder Support
Thank you so much TheGreyGhost! This fixed everything! -
Hello all. First time modding. I am creating a mod with a whole slew of custom rendered 3D Models. I have having a particularly hard time saving the direction states. In my code below, I am able to place the blocks and have them face my character, but when one logs out of the world, then logs back in, it has reset its position to face the north. Main Block Class: public class ComputerPerf extends BlockContainer { public ComputerPerf(Material material) { super(material); this.setHardness(2.0F); this.setResistance(5.0F); this.setBlockBounds(0F, 0F, 0F, 1F, 0.8125F, 1F); this.setCreativeTab(Misccraft.misccraftTab); } public int getRenderType() { return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World var1, int var2) { return new TileEntityComputerPerf(); } @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityplayer, ItemStack itemstack) { if(entityplayer == null) { return; } TileEntityComputerPerf perf = (TileEntityComputerPerf)world.getTileEntity(x,y,z); perf.direction = MathHelper.floor_double((double)((entityplayer.rotationYaw*4F)/360F) + 0.5D) & 3; } } Renderer: public class RenderComputerPerf extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(Misccraft.MODID + ":" + "textures/model/ComputerPerf.png"); private ModelComputerPerf model; public RenderComputerPerf() { this.model = new ModelComputerPerf(); } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef(((float)x + 0.5F), (float)y + 1.5F, (float)z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); this.bindTexture(texture); TileEntityComputerPerf perf = (TileEntityComputerPerf)tileentity; int direction = perf.direction; GL11.glRotatef(direction * 90, 0.0F, 1.0F, 0.0F); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } TileEntity: public class TileEntityComputerPerf extends TileEntity { public int direction; } ClientProxy: public class ClientProxy extends CommonProxy { public void registerRenderModels() { TileEntitySpecialRenderer render1 = new RenderComputerPerf(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityComputerPerf.class, render1); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Misccraft.blockComputerPerf), new ItemRenderComputerPerf(render1, new TileEntityComputerPerf())); } public void registerTileEntitySpecialRenderer() { } } Any help on this would be appreciated. Thanks!