Jump to content

AnonymousModder

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by AnonymousModder

  1. Thanks a ton! I was forgetting the build.bat!
  2. I'm trying to setup a 1.9 Minecraft mod the way I did in 1.8, and it doesn't seem to be working correctly. Is there supposed to be a forgeSrc-[FORGE VERSION]? Or did setting up the main class change. Could someone send me a link to a tutorial on how to set up a 1.9 mod?
  3. Okay, so I have come to the conclusion that watching a 1.7 tutorial is bad for 1.8, so does anyone know any tutorials for custom structures for 1.8? I created a custom structure for Minecraft 1.8 and used MCEdit to get the schematic, and then Jajo_11's Schematic to Structure Converter. My main problem is that inside the structure's class, the .getBlock it used many times, giving me an error. Structure's Class public class SwirlRock extends WorldGenerator { protected Block[] GetValidSpawnBlocks() { return new Block[] { Blocks.grass, }; } public boolean LocationIsValidSpawn(World world, int x, int y, int z) { >>>> Block checkBlock = world.getBlock(x, y - 1, z); >>>> Block blockAbove = world.getBlock(x, y , z); >>>> Block blockBelow = world.getBlockstate(x, y - 2, z); for (Block i : GetValidSpawnBlocks()) { if (blockAbove != Blocks.air) { return false; } if (checkBlock == i) { return true; } else if (checkBlock == Blocks.snow_layer && blockBelow == i) { return true; } else if (checkBlock.getMaterial() == Material.plants && blockBelow == i) { return true; } } return false; } public boolean generate(World world, Random rand, int x, int y, int z) { int i = rand.nextInt(1); if(i == 0) { generate_r0(world, rand, x, y, z); } return true; } public boolean generate_r0(World world, Random rand, int x, int y, int z) { if(!LocationIsValidSpawn(world, x, y, z) || !LocationIsValidSpawn(world, x + 0, y, z) || !LocationIsValidSpawn(world, x + 0, y, z + 0) || !LocationIsValidSpawn(world, x, y, z + 0)) { return false; } >>> > world.setBlock(x + 0, y + 0, z + 0, ModBlocks.swirl_rock, 1, 3); return true; } }
  4. I had tried that, but Minecraft crashes whenever I open it. It appears to be in the init() method. Do you see anything wrong with it? Crash Report ---- Minecraft Crash Report ---- // Would you like a cupcake? Time: 2/23/16 6:14 AM Description: Initializing game java.lang.ArrayIndexOutOfBoundsException: 765 at net.minecraft.world.biome.BiomeGenBase.<init>(BiomeGenBase.java:192) at net.minecraft.world.biome.BiomeGenBase.<init>(BiomeGenBase.java:170) at steamfox.pinesmod.biomes.BiomeEnchantedForest.<init>(BiomeEnchantedForest.java:11) at steamfox.pinesmod.init.ModBiomes.init(ModBiomes.java:17) at steamfox.pinesmod.PinesMod.preInit(PinesMod.java:51) 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:553) 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:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) 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:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.world.biome.BiomeGenBase.<init>(BiomeGenBase.java:192) at net.minecraft.world.biome.BiomeGenBase.<init>(BiomeGenBase.java:170) at steamfox.pinesmod.biomes.BiomeEnchantedForest.<init>(BiomeEnchantedForest.java:11) at steamfox.pinesmod.init.ModBiomes.init(ModBiomes.java:17) at steamfox.pinesmod.PinesMod.preInit(PinesMod.java:51) 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:553) 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:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) 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:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) 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(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_65, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 689225280 bytes (657 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 v9.10 FML v8.0.99.99 Minecraft Forge 11.14.4.1577 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1577.jar) UCH Forge{11.14.4.1577} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1577.jar) UCE pm{DEV Update 1.3.2} [Pines Mod] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 358.91' Renderer: 'NVS 5200M/PCIe/SSE2' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: NVS 5200M/PCIe/SSE2 GL version 4.5.0 NVIDIA 358.91, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled)
  5. Am I supposed to put something like ModBiomes.init() and ModBiomes.register() my main class?
  6. No matter what number I put, I can't find my biome anywhere. What am I doing wrong?
  7. Oh, well what number should I put so I can almost instantly find my biome?
  8. EDIT: No matter what number I put, I can't find my biome anywhere. What am I doing wrong? I created a simple custom biome and I couldn't find it, so I changed some numbers so now the spawn rate is 100%. I still cannot find my biome. I think I may have done something wrong, but I do not know what. Here's my BiomeRegistry code: public static BiomeGenBase enchanted_forest; public static void init(){ enchanted_forest = new BiomeEnchantedForest(341).setBiomeName("enchanted_forest"); } public static void register(){ BiomeDictionary.registerBiomeType(enchanted_forest, Type.FOREST); BiomeEntry enchantedForestEntry = new BiomeEntry(enchanted_forest, 100); BiomeManager.addBiome(BiomeType.WARM, enchantedForestEntry); } Here's my EnchantedForestBiome code public class BiomeEnchantedForest extends BiomeGenBase{ public BiomeEnchantedForest(int p_i1971_1_) { super(p_i1971_1_); this.spawnableCreatureList.add(new SpawnListEntry(MobGnomeMob.class, 30, 2, 10)); this.theBiomeDecorator.treesPerChunk = 5; this.theBiomeDecorator.waterlilyPerChunk = 5; this.theBiomeDecorator.reedsPerChunk = 100; this.theBiomeDecorator.sandPerChunk2 = 20; this.theBiomeDecorator.generateLakes = true; this.theBiomeDecorator.grassPerChunk = 25; this.theBiomeDecorator.bigMushroomsPerChunk = 2; } }
  9. I was able to figure it out! When you create a slot you use "this.addSlotToContainer(new SlotCrafting". What you need to do is create a custom SlotCrafting class with the same code, however there is one line that says "ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(this.craftMatrix, playerIn.worldObj);" and change the "CraftingManager" to your custom Crafting Manager class. Hope that helps for anyone with the same problem.
  10. EDIT - my items craft and disspear from the custom crafting table, however Minecraft crashes when exiting the world. I'd love to know how to fix this. I updated the crash report below. I have a custom crafting table that when you craft something in it the items in both slots do not dissapear. Also, when you close the Minecraft world the game crashes. I have gone all over the internet trying to find a solution and I've seen other people have had the same problem. I've looked at the crafting table's container and I've got the same code, yet I'm still having this problem. Crash Report - Container Class - public class ContainerVendingMachine extends Container { public InventoryCrafting craftMatrix; public IInventory craftResult; private World worldObj; private int posX; private int posY; private int posZ; public ContainerVendingMachine(InventoryPlayer invPlayer, World world, int x, int y, int z){ craftMatrix = new InventoryCrafting(this, 1, 1); craftResult = new InventoryCraftResult(); worldObj = world; posX = x; posY = y; posZ = z; this.addSlotToContainer(new SlotCrafting(invPlayer.player, craftMatrix, craftResult, 0, 124, 45)); for (int i = 0; i < 1; i++){ for(int k = 0; k < 1; k++){ this.addSlotToContainer(new Slot(craftMatrix, k + i * 5, 48 + k * 18, 45 + i * 18)); } } for (int i = 0; i < 3; i++){ for(int k = 0; k <9; k++){ this.addSlotToContainer(new Slot(invPlayer, k + i * 9 + 9, 8 + k * 18, 94 + i * 18)); } } for (int i = 0; i < 9; i++){ this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 152)); } onCraftMatrixChanged(craftMatrix); } public void onCraftMatrixChanged(IInventory iinventory) { craftResult.setInventorySlotContents(0, VendingMachineManager.getInstance().findMatchingRecipe(craftMatrix, worldObj)); } @Override public boolean canInteractWith(EntityPlayer playerIn) { return true; } public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; Slot slot = (Slot)this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (index == 0) { if (!this.mergeItemStack(itemstack1, 10, 46, true)) { return null; } slot.onSlotChange(itemstack1, itemstack); } else if (index >= 10 && index < 37) { if (!this.mergeItemStack(itemstack1, 37, 46, false)) { return null; } } else if (index >= 37 && index < 46) { if (!this.mergeItemStack(itemstack1, 10, 37, false)) { return null; } } else if (!this.mergeItemStack(itemstack1, 10, 46, false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack)null); } else { slot.onSlotChanged(); } if (itemstack1.stackSize == itemstack.stackSize) { return null; } slot.onPickupFromSlot(playerIn, itemstack1); } return itemstack; } public void onContainerClosed(EntityPlayer playerIn) { super.onContainerClosed(playerIn); if (!this.worldObj.isRemote) { for (int i = 0; i < 9; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != null) { playerIn.dropPlayerItemWithRandomChoice(itemstack, false); } } } } } If you need any more classes just ask.
  11. After "this." model is not something that shows up.
  12. Okay Main Mod File EntityRegistry.registerModEntity(EntityBlast.class, "Blast", 0, PinesMod.modInstance, 64, 10, true); ClientProxy RenderingRegistry.registerEntityRenderingHandler(EntityBlast.class, new RenderBlast(Minecraft.getMinecraft().getRenderManager(), new ModelBlast(), 0)); EntityBlast public class EntityBlast extends EntityThrowable implements IProjectile{ private int xTile = -1; private int yTile = -1; private int zTile = -1; private Block inTile; private int inData; private boolean inGround; public int arrowShake; public Entity shootingEntity; private int ticksInGround; private int ticksInAir; private double damage = 3.5D; private int knockbackStrength; public EntityBlast(World worldIn) { super(worldIn); this.renderDistanceWeight = 10.0D; this.setSize(0.5F, 0.5F); } public EntityBlast(World worldIn, double x, double y, double z) { super(worldIn); this.renderDistanceWeight = 10.0D; this.setSize(0.5F, 0.5F); this.setPosition(x, y, z); } public EntityBlast(World worldIn, EntityLivingBase shooter, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) { super(worldIn); this.renderDistanceWeight = 10.0D; this.shootingEntity = shooter; this.posY = shooter.posY + (double)shooter.getEyeHeight() - 0.10000000149011612D; double d0 = p_i1755_3_.posX - shooter.posX; double d1 = p_i1755_3_.getEntityBoundingBox().minY + (double)(p_i1755_3_.height / 3.0F) - this.posY; double d2 = p_i1755_3_.posZ - shooter.posZ; double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2); if (d3 >= 1.0E-7D) { float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); double d4 = d0 / d3; double d5 = d2 / d3; this.setLocationAndAngles(shooter.posX + d4, this.posY, shooter.posZ + d5, f2, f3); float f4 = (float)(d3 * 0.20000000298023224D); this.setThrowableHeading(d0, d1 + (double)f4, d2, p_i1755_4_, p_i1755_5_); } } public EntityBlast(World worldIn, EntityLivingBase shooter, float p_i1756_3_) { super(worldIn); this.renderDistanceWeight = 10.0D; this.shootingEntity = shooter; this.setSize(0.5F, 0.5F); this.setLocationAndAngles(shooter.posX, shooter.posY + (double)shooter.getEyeHeight(), shooter.posZ, shooter.rotationYaw, shooter.rotationPitch); this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); this.posY -= 0.10000000149011612D; this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); this.setPosition(this.posX, this.posY, this.posZ); this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); } protected void entityInit() { this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); } public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy) { float f2 = MathHelper.sqrt_double(x * x + y * y + z * z); x /= (double)f2; y /= (double)f2; z /= (double)f2; x += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy; y += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy; z += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy; x *= (double)velocity; y *= (double)velocity; z *= (double)velocity; this.motionX = x; this.motionY = y; this.motionZ = z; float f3 = MathHelper.sqrt_double(x * x + z * z); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f3) * 180.0D / Math.PI); this.ticksInGround = 0; } @SideOnly(Side.CLIENT) public void func_180426_a(double p_180426_1_, double p_180426_3_, double p_180426_5_, float p_180426_7_, float p_180426_8_, int p_180426_9_, boolean p_180426_10_) { this.setPosition(p_180426_1_, p_180426_3_, p_180426_5_); this.setRotation(p_180426_7_, p_180426_8_); } @SideOnly(Side.CLIENT) public void setVelocity(double x, double y, double z) { this.motionX = x; this.motionY = y; this.motionZ = z; if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float f = MathHelper.sqrt_double(x * x + z * z); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch; this.prevRotationYaw = this.rotationYaw; this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); this.ticksInGround = 0; } } public void onUpdate() { super.onUpdate(); if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); } BlockPos blockpos = new BlockPos(this.xTile, this.yTile, this.zTile); IBlockState iblockstate = this.worldObj.getBlockState(blockpos); Block block = iblockstate.getBlock(); if (block.getMaterial() != Material.air) { block.setBlockBoundsBasedOnState(this.worldObj, blockpos); AxisAlignedBB axisalignedbb = block.getCollisionBoundingBox(this.worldObj, blockpos, iblockstate); if (axisalignedbb != null && axisalignedbb.isVecInside(new Vec3(this.posX, this.posY, this.posZ))) { this.inGround = true; } } if (this.arrowShake > 0) { --this.arrowShake; } if (this.inGround) { int j = block.getMetaFromState(iblockstate); if (block == this.inTile && j == this.inData) { ++this.ticksInGround; if (this.ticksInGround >= 1200) { this.setDead(); } } else { this.inGround = false; this.motionX *= (double)(this.rand.nextFloat() * 0.2F); this.motionY *= (double)(this.rand.nextFloat() * 0.2F); this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); this.ticksInGround = 0; this.ticksInAir = 0; } } else { ++this.ticksInAir; Vec3 vec31 = new Vec3(this.posX, this.posY, this.posZ); Vec3 vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec31, vec3, false, true, false); vec31 = new Vec3(this.posX, this.posY, this.posZ); vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); if (movingobjectposition != null) { vec3 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); } Entity entity = null; List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); double d0 = 0.0D; int i; float f1; for (i = 0; i < list.size(); ++i) { Entity entity1 = (Entity)list.get(i); if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { f1 = 0.3F; AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().expand((double)f1, (double)f1, (double)f1); MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); if (movingobjectposition1 != null) { double d1 = vec31.distanceTo(movingobjectposition1.hitVec); if (d1 < d0 || d0 == 0.0D) { entity = entity1; d0 = d1; } } } } if (entity != null) { movingobjectposition = new MovingObjectPosition(entity); } if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) { movingobjectposition = null; } } float f2; float f3; float f4; if (movingobjectposition != null) { if (movingobjectposition.entityHit != null) { f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); int k = MathHelper.ceiling_double_int((double)f2 * this.damage); if (this.getIsCritical()) { k += this.rand.nextInt(k / 2 + 2); } DamageSource damagesource; if (this.shootingEntity == null) { damagesource = DamageSource.causeArrowDamage(null, null); } else { damagesource = DamageSource.causeArrowDamage(null, this.shootingEntity); } if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) { movingobjectposition.entityHit.setFire(5); } if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float)k)) { if (movingobjectposition.entityHit instanceof EntityLivingBase) { EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit; if (!this.worldObj.isRemote) { entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1); } if (this.knockbackStrength > 0) { f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); if (f4 > 0.0F) { movingobjectposition.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4); } } if (this.shootingEntity instanceof EntityLivingBase) { EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity); EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase); } if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); } } if (!(movingobjectposition.entityHit instanceof EntityEnderman)) { this.setDead(); } } else { this.motionX *= -0.10000000149011612D; this.motionY *= -0.10000000149011612D; this.motionZ *= -0.10000000149011612D; this.rotationYaw += 180.0F; this.prevRotationYaw += 180.0F; this.ticksInAir = 0; } } else { BlockPos blockpos1 = movingobjectposition.getBlockPos(); this.xTile = blockpos1.getX(); this.yTile = blockpos1.getY(); this.zTile = blockpos1.getZ(); iblockstate = this.worldObj.getBlockState(blockpos1); this.inTile = iblockstate.getBlock(); this.inData = this.inTile.getMetaFromState(iblockstate); this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX)); this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY)); this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ)); f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); this.posX -= this.motionX / (double)f3 * 0.05000000074505806D; this.posY -= this.motionY / (double)f3 * 0.05000000074505806D; this.posZ -= this.motionZ / (double)f3 * 0.05000000074505806D; this.inGround = true; this.arrowShake = 7; this.setIsCritical(false); if (this.inTile.getMaterial() != Material.air) { this.inTile.onEntityCollidedWithBlock(this.worldObj, blockpos1, iblockstate, this); } } } if (this.getIsCritical()) { for (i = 0; i < 4; ++i) { this.worldObj.spawnParticle(EnumParticleTypes.CRIT, this.posX + this.motionX * (double)i / 4.0D, this.posY + this.motionY * (double)i / 4.0D, this.posZ + this.motionZ * (double)i / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ, new int[0]); } } this.posX += this.motionX; this.posY += this.motionY; this.posZ += this.motionZ; f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ; } while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { this.prevRotationPitch += 360.0F; } while (this.rotationYaw - this.prevRotationYaw < -180.0F) { this.prevRotationYaw -= 360.0F; } while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { this.prevRotationYaw += 360.0F; } this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; f3 = 0.99F; f1 = 0.05F; if (this.isInWater()) { for (int l = 0; l < 4; ++l) { f4 = 0.25F; this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ, new int[0]); } f3 = 0.6F; } if (this.isWet()) { this.extinguish(); } this.motionX *= (double)f3; this.motionY *= (double)f3; this.motionZ *= (double)f3; this.motionY -= (double)f1; this.setPosition(this.posX, this.posY, this.posZ); this.doBlockCollisions(); } } public void writeEntityToNBT(NBTTagCompound tagCompound) { tagCompound.setShort("xTile", (short)this.xTile); tagCompound.setShort("yTile", (short)this.yTile); tagCompound.setShort("zTile", (short)this.zTile); tagCompound.setShort("life", (short)this.ticksInGround); ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile); tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); tagCompound.setByte("inData", (byte)this.inData); tagCompound.setByte("shake", (byte)this.arrowShake); tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); tagCompound.setDouble("damage", this.damage); } public void readEntityFromNBT(NBTTagCompound tagCompund) { this.xTile = tagCompund.getShort("xTile"); this.yTile = tagCompund.getShort("yTile"); this.zTile = tagCompund.getShort("zTile"); this.ticksInGround = tagCompund.getShort("life"); if (tagCompund.hasKey("inTile", ) { this.inTile = Block.getBlockFromName(tagCompund.getString("inTile")); } else { this.inTile = Block.getBlockById(tagCompund.getByte("inTile") & 255); } this.inData = tagCompund.getByte("inData") & 255; this.arrowShake = tagCompund.getByte("shake") & 255; this.inGround = tagCompund.getByte("inGround") == 1; if (tagCompund.hasKey("damage", 99)) { this.damage = tagCompund.getDouble("damage"); } } public void onCollideWithPlayer(EntityPlayer entityIn) { if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) { this.setDead(); } } protected boolean canTriggerWalking() { return false; } public void setDamage(double p_70239_1_) { this.damage = p_70239_1_; } public double getDamage() { return this.damage; } public void setKnockbackStrength(int p_70240_1_) { this.knockbackStrength = p_70240_1_; } public boolean canAttackWithItem() { return false; } public void setIsCritical(boolean p_70243_1_) { byte b0 = this.dataWatcher.getWatchableObjectByte(16); if (p_70243_1_) { this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); } else { this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); } } public boolean getIsCritical() { byte b0 = this.dataWatcher.getWatchableObjectByte(16); return (b0 & 1) != 0; } @Override protected void onImpact(MovingObjectPosition p_70184_1_) { } } ModelBlast public class ModelBlast extends ModelBase { ModelRenderer Shape1; public ModelBlast() { textureWidth = 64; textureHeight = 32; Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(0F, 0F, 0F, 7, 3, 3); Shape1.setRotationPoint(-1.5F, 19F, 3.5F); Shape1.setTextureSize(64, 32); Shape1.mirror = true; setRotation(Shape1, 0F, 1.570796F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Shape1.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } RenderBlast public class RenderBlast extends Render{ private static final ResourceLocation blastTextures = new ResourceLocation(Reference.MOD_ID + ":textures/mob/Blast.png"); public RenderBlast(RenderManager par1RenderManager, ModelBase par2ModelBase, float par3) { super(par1RenderManager); } protected ResourceLocation getEntityTexture(EntityBlast entity){ return blastTextures; } protected ResourceLocation getEntityTexture(Entity entity){ return this.getEntityTexture((EntityBlast)entity); } } ItemBlaster (Not relevant) private int firingDelay = 20; @Override public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean j) { firingDelay++; } @SideOnly(Side.CLIENT) public boolean isFull3D() { return true; } @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { System.out.println(firingDelay); { if (!world.isRemote) { world.spawnEntityInWorld(new EntityBlast(world, player, 3)); } } return itemstack; }
  13. I did everything you said but it still doesn't work.
  14. EntityBlastRegister Class public class EntityBlastRegister { public static void PinesMod() { registerEntity(); } public static void registerEntity() { createEntity(EntityBlast.class, "Blast", 0xBBBBBB, 0xBBBBBB); } public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor){ int randomId = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerModEntity(entityClass, entityName, randomId, PinesMod.modInstance, 14, 1, true); } }
  15. Oh yeah! I forgot to change that. It didn't fix the problem, though.
  16. I created a blaster that shoots a custom projectile. The projectile hurts mobs when they get shot at, but you can't see the projectile at all. EntityBlast public class EntityBlast extends Entity implements IProjectile{ private int xTile = -1; private int yTile = -1; private int zTile = -1; private Block inTile; private int inData; private boolean inGround; public int arrowShake; public Entity shootingEntity; private int ticksInGround; private int ticksInAir; private double damage = 3.5D; private int knockbackStrength; public EntityBlast(World worldIn) { super(worldIn); this.renderDistanceWeight = 10.0D; this.setSize(0.5F, 0.5F); } public EntityBlast(World worldIn, double x, double y, double z) { super(worldIn); this.renderDistanceWeight = 10.0D; this.setSize(0.5F, 0.5F); this.setPosition(x, y, z); } public EntityBlast(World worldIn, EntityLivingBase shooter, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) { super(worldIn); this.renderDistanceWeight = 10.0D; this.shootingEntity = shooter; this.posY = shooter.posY + (double)shooter.getEyeHeight() - 0.10000000149011612D; double d0 = p_i1755_3_.posX - shooter.posX; double d1 = p_i1755_3_.getEntityBoundingBox().minY + (double)(p_i1755_3_.height / 3.0F) - this.posY; double d2 = p_i1755_3_.posZ - shooter.posZ; double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2); if (d3 >= 1.0E-7D) { float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); double d4 = d0 / d3; double d5 = d2 / d3; this.setLocationAndAngles(shooter.posX + d4, this.posY, shooter.posZ + d5, f2, f3); float f4 = (float)(d3 * 0.20000000298023224D); this.setThrowableHeading(d0, d1 + (double)f4, d2, p_i1755_4_, p_i1755_5_); } } public EntityBlast(World worldIn, EntityLivingBase shooter, float p_i1756_3_) { super(worldIn); this.renderDistanceWeight = 10.0D; this.shootingEntity = shooter; this.setSize(0.5F, 0.5F); this.setLocationAndAngles(shooter.posX, shooter.posY + (double)shooter.getEyeHeight(), shooter.posZ, shooter.rotationYaw, shooter.rotationPitch); this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); this.posY -= 0.10000000149011612D; this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); this.setPosition(this.posX, this.posY, this.posZ); this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); } protected void entityInit() { this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); } public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy) { float f2 = MathHelper.sqrt_double(x * x + y * y + z * z); x /= (double)f2; y /= (double)f2; z /= (double)f2; x += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy; y += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy; z += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy; x *= (double)velocity; y *= (double)velocity; z *= (double)velocity; this.motionX = x; this.motionY = y; this.motionZ = z; float f3 = MathHelper.sqrt_double(x * x + z * z); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f3) * 180.0D / Math.PI); this.ticksInGround = 0; } @SideOnly(Side.CLIENT) public void func_180426_a(double p_180426_1_, double p_180426_3_, double p_180426_5_, float p_180426_7_, float p_180426_8_, int p_180426_9_, boolean p_180426_10_) { this.setPosition(p_180426_1_, p_180426_3_, p_180426_5_); this.setRotation(p_180426_7_, p_180426_8_); } @SideOnly(Side.CLIENT) public void setVelocity(double x, double y, double z) { this.motionX = x; this.motionY = y; this.motionZ = z; if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float f = MathHelper.sqrt_double(x * x + z * z); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch; this.prevRotationYaw = this.rotationYaw; this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); this.ticksInGround = 0; } } public void onUpdate() { super.onUpdate(); if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); } BlockPos blockpos = new BlockPos(this.xTile, this.yTile, this.zTile); IBlockState iblockstate = this.worldObj.getBlockState(blockpos); Block block = iblockstate.getBlock(); if (block.getMaterial() != Material.air) { block.setBlockBoundsBasedOnState(this.worldObj, blockpos); AxisAlignedBB axisalignedbb = block.getCollisionBoundingBox(this.worldObj, blockpos, iblockstate); if (axisalignedbb != null && axisalignedbb.isVecInside(new Vec3(this.posX, this.posY, this.posZ))) { this.inGround = true; } } if (this.arrowShake > 0) { --this.arrowShake; } if (this.inGround) { int j = block.getMetaFromState(iblockstate); if (block == this.inTile && j == this.inData) { ++this.ticksInGround; if (this.ticksInGround >= 1200) { this.setDead(); } } else { this.inGround = false; this.motionX *= (double)(this.rand.nextFloat() * 0.2F); this.motionY *= (double)(this.rand.nextFloat() * 0.2F); this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); this.ticksInGround = 0; this.ticksInAir = 0; } } else { ++this.ticksInAir; Vec3 vec31 = new Vec3(this.posX, this.posY, this.posZ); Vec3 vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec31, vec3, false, true, false); vec31 = new Vec3(this.posX, this.posY, this.posZ); vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); if (movingobjectposition != null) { vec3 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); } Entity entity = null; List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); double d0 = 0.0D; int i; float f1; for (i = 0; i < list.size(); ++i) { Entity entity1 = (Entity)list.get(i); if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { f1 = 0.3F; AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().expand((double)f1, (double)f1, (double)f1); MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); if (movingobjectposition1 != null) { double d1 = vec31.distanceTo(movingobjectposition1.hitVec); if (d1 < d0 || d0 == 0.0D) { entity = entity1; d0 = d1; } } } } if (entity != null) { movingobjectposition = new MovingObjectPosition(entity); } if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) { movingobjectposition = null; } } float f2; float f3; float f4; if (movingobjectposition != null) { if (movingobjectposition.entityHit != null) { f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); int k = MathHelper.ceiling_double_int((double)f2 * this.damage); if (this.getIsCritical()) { k += this.rand.nextInt(k / 2 + 2); } DamageSource damagesource; if (this.shootingEntity == null) { damagesource = DamageSource.causeArrowDamage(null, null); } else { damagesource = DamageSource.causeArrowDamage(null, this.shootingEntity); } if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) { movingobjectposition.entityHit.setFire(5); } if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float)k)) { if (movingobjectposition.entityHit instanceof EntityLivingBase) { EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit; if (!this.worldObj.isRemote) { entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1); } if (this.knockbackStrength > 0) { f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); if (f4 > 0.0F) { movingobjectposition.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4); } } if (this.shootingEntity instanceof EntityLivingBase) { EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity); EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase); } if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); } } if (!(movingobjectposition.entityHit instanceof EntityEnderman)) { this.setDead(); } } else { this.motionX *= -0.10000000149011612D; this.motionY *= -0.10000000149011612D; this.motionZ *= -0.10000000149011612D; this.rotationYaw += 180.0F; this.prevRotationYaw += 180.0F; this.ticksInAir = 0; } } else { BlockPos blockpos1 = movingobjectposition.getBlockPos(); this.xTile = blockpos1.getX(); this.yTile = blockpos1.getY(); this.zTile = blockpos1.getZ(); iblockstate = this.worldObj.getBlockState(blockpos1); this.inTile = iblockstate.getBlock(); this.inData = this.inTile.getMetaFromState(iblockstate); this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX)); this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY)); this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ)); f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); this.posX -= this.motionX / (double)f3 * 0.05000000074505806D; this.posY -= this.motionY / (double)f3 * 0.05000000074505806D; this.posZ -= this.motionZ / (double)f3 * 0.05000000074505806D; this.inGround = true; this.arrowShake = 7; this.setIsCritical(false); if (this.inTile.getMaterial() != Material.air) { this.inTile.onEntityCollidedWithBlock(this.worldObj, blockpos1, iblockstate, this); } } } if (this.getIsCritical()) { for (i = 0; i < 4; ++i) { this.worldObj.spawnParticle(EnumParticleTypes.CRIT, this.posX + this.motionX * (double)i / 4.0D, this.posY + this.motionY * (double)i / 4.0D, this.posZ + this.motionZ * (double)i / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ, new int[0]); } } this.posX += this.motionX; this.posY += this.motionY; this.posZ += this.motionZ; f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ; } while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { this.prevRotationPitch += 360.0F; } while (this.rotationYaw - this.prevRotationYaw < -180.0F) { this.prevRotationYaw -= 360.0F; } while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { this.prevRotationYaw += 360.0F; } this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; f3 = 0.99F; f1 = 0.05F; if (this.isInWater()) { for (int l = 0; l < 4; ++l) { f4 = 0.25F; this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ, new int[0]); } f3 = 0.6F; } if (this.isWet()) { this.extinguish(); } this.motionX *= (double)f3; this.motionY *= (double)f3; this.motionZ *= (double)f3; this.motionY -= (double)f1; this.setPosition(this.posX, this.posY, this.posZ); this.doBlockCollisions(); } } public void writeEntityToNBT(NBTTagCompound tagCompound) { tagCompound.setShort("xTile", (short)this.xTile); tagCompound.setShort("yTile", (short)this.yTile); tagCompound.setShort("zTile", (short)this.zTile); tagCompound.setShort("life", (short)this.ticksInGround); ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile); tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); tagCompound.setByte("inData", (byte)this.inData); tagCompound.setByte("shake", (byte)this.arrowShake); tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); tagCompound.setDouble("damage", this.damage); } public void readEntityFromNBT(NBTTagCompound tagCompund) { this.xTile = tagCompund.getShort("xTile"); this.yTile = tagCompund.getShort("yTile"); this.zTile = tagCompund.getShort("zTile"); this.ticksInGround = tagCompund.getShort("life"); if (tagCompund.hasKey("inTile", ) { this.inTile = Block.getBlockFromName(tagCompund.getString("inTile")); } else { this.inTile = Block.getBlockById(tagCompund.getByte("inTile") & 255); } this.inData = tagCompund.getByte("inData") & 255; this.arrowShake = tagCompund.getByte("shake") & 255; this.inGround = tagCompund.getByte("inGround") == 1; if (tagCompund.hasKey("damage", 99)) { this.damage = tagCompund.getDouble("damage"); } } public void onCollideWithPlayer(EntityPlayer entityIn) { if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) { this.setDead(); } } protected boolean canTriggerWalking() { return false; } public void setDamage(double p_70239_1_) { this.damage = p_70239_1_; } public double getDamage() { return this.damage; } public void setKnockbackStrength(int p_70240_1_) { this.knockbackStrength = p_70240_1_; } public boolean canAttackWithItem() { return false; } public void setIsCritical(boolean p_70243_1_) { byte b0 = this.dataWatcher.getWatchableObjectByte(16); if (p_70243_1_) { this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); } else { this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); } } public boolean getIsCritical() { byte b0 = this.dataWatcher.getWatchableObjectByte(16); return (b0 & 1) != 0; } ModelBlast public class ModelBlast extends ModelBase { ModelRenderer Shape1; public ModelBlast() { textureWidth = 64; textureHeight = 32; Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(0F, 0F, 0F, 7, 3, 3); Shape1.setRotationPoint(-1.5F, 19F, 3.5F); Shape1.setTextureSize(64, 32); Shape1.mirror = true; setRotation(Shape1, 0F, 1.570796F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Shape1.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } RenderBlast public class RenderBlast extends RenderLiving{ private static final ResourceLocation blastTextures = new ResourceLocation(Reference.MOD_ID + ":textures/mob/Blast.png"); public RenderBlast(RenderManager par1RenderManager, ModelBase par2ModelBase, float par3) { super(par1RenderManager, par2ModelBase, par3); } protected ResourceLocation getEntityTexture(EntityBlast entity){ return blastTextures; } protected ResourceLocation getEntityTexture(Entity entity){ return this.getEntityTexture((EntityBlast)entity); } } Blaster private int firingDelay = 20; @Override public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean j) { firingDelay++; } @SideOnly(Side.CLIENT) public boolean isFull3D() { return true; } @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { System.out.println(firingDelay); { if (!world.isRemote) { world.spawnEntityInWorld(new EntityBlast(world, player, 3)); } } return itemstack; } ClientProxy Line RenderingRegistry.registerEntityRenderingHandler(EntityBlast.class, new RenderBlast(Minecraft.getMinecraft().getRenderManager(), new ModelBlast(), 0));
  17. I was able to convert a Techne item model into a JSON using MrCrayfish's Model Creator, but the item placement is a bit off. I would normally have the "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 15 ], "translation": [ 0, 6, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } In normal model files that use textures, but it isn't present in my 3D model file. 3D Model File { "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", "textures": { "0": "pm:items/laser_arm_cannon_texture", "1": "pm:blocks/New canvas" }, "elements": [ { "name": "Cube1", "from": [ 5.5, 4.0, 4.0 ], "to": [ 10.5, 9.0, 12.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 2.0, 3.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 3.2 ] }, "south": { "texture": "#0", "uv": [ 6.5, 2.0, 5.3, 3.2 ] }, "west": { "texture": "#0", "uv": [ 2.0, 2.0, 0.0, 3.2 ] }, "up": { "texture": "#0", "uv": [ 4.0, 0.0, 4.0, 2.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 0.0, 3.0, 2.0 ] } } }, { "name": "Cube2", "from": [ 7.5, 9.0, 4.0 ], "to": [ 8.5, 10.0, 5.0 ], "faces": { "north": { "texture": "#1", "uv": [ 1.0, 16.0, 2.0, 15.0 ] }, "east": { "texture": "#1", "uv": [ 2.0, 15.0, 1.0, 16.0 ] }, "south": { "texture": "#1", "uv": [ 1.0, 15.0, 2.0, 16.0 ] }, "west": { "texture": "#1", "uv": [ 1.0, 16.0, 2.0, 15.0 ] }, "up": { "texture": "#1", "uv": [ 1.0, 15.0, 2.0, 16.0 ] }, "down": { "texture": "#1", "uv": [ 1.0, 15.0, 2.0, 16.0 ] } } }, { "name": "Cube3", "from": [ 7.0, 10.0, 4.0 ], "to": [ 9.0, 12.0, 5.0 ], "faces": { "north": { "texture": "#1", "uv": [ 1.0, 15.0, 2.0, 16.0 ] }, "east": { "texture": "#1", "uv": [ 1.0, 15.0, 2.0, 16.0 ] }, "south": { "texture": "#1", "uv": [ 1.0, 15.0, 2.0, 16.0 ] }, "west": { "texture": "#1", "uv": [ 2.0, 15.0, 1.0, 16.0 ] }, "up": { "texture": "#1", "uv": [ 1.0, 15.0, 2.0, 16.0 ] }, "down": { "texture": "#1", "uv": [ 1.0, 15.0, 2.0, 16.0 ] } } }, { "name": "Cube4", "from": [ 7.5, 9.0, 11.0 ], "to": [ 8.5, 10.0, 12.0 ], "faces": { "north": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "east": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "south": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "west": { "texture": "#1", "uv": [ 5.0, 1.0, 6.0, 2.0 ] }, "up": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "down": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] } } }, { "name": "Cube5", "from": [ 5.0, 6.0, 5.0 ], "to": [ 6.0, 7.0, 10.0 ], "faces": { "north": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 1.0 ] }, "east": { "texture": "#1", "uv": [ 1.0, 3.0, 2.0, 4.0 ] }, "south": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "west": { "texture": "#1", "uv": [ 4.0, 2.0, 5.0, 1.0 ] }, "up": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "down": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] } } }, { "name": "Cube6", "from": [ 10.0, 6.0, 5.0 ], "to": [ 11.0, 7.0, 10.0 ], "faces": { "north": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "east": { "texture": "#1", "uv": [ 5.0, 1.0, 6.0, 2.0 ] }, "south": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "west": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "up": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] }, "down": { "texture": "#1", "uv": [ 4.0, 1.0, 5.0, 2.0 ] } } }, { "name": "Cube7", "from": [ 7.5, -0.5, 5.8 ], "to": [ 8.5, 3.5, 7.8 ], "rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 22.5 }, "faces": { "north": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "east": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "south": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "west": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "up": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "down": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] } } }, { "name": "Cube8", "from": [ 7.5, 2.0, 5.0 ], "to": [ 8.5, 3.0, 9.0 ], "faces": { "north": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "east": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "south": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "west": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "up": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "down": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] } } }, { "name": "Cube9", "from": [ 7.5, 2.0, 8.0 ], "to": [ 8.5, 4.0, 9.0 ], "faces": { "north": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "east": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "south": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "west": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "up": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] }, "down": { "texture": "#1", "uv": [ 1.0, 7.0, 2.0, 7.0 ] } } } ] } Where and how can I change my rotation, translation, and scale?
  18. I created a model for an item and made all the rendering and item classes, but the model isn't rendering. There is a line through every IItemRenderer, ItemRenderType, ItemRendererHelper, EQUIPPED, EQUIPPED_FIRST_PERSON for some odd reason. Model Class public class ModelLaserArmCannon extends ModelBase { //fields ModelRenderer Shape1; ModelRenderer Shape2; ModelRenderer Shape3; ModelRenderer Shape4; ModelRenderer Shape5; ModelRenderer Shape6; ModelRenderer Shape7; ModelRenderer Shape8; ModelRenderer Shape9; public ModelLaserArmCannon() { textureWidth = 64; textureHeight = 64; Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(0F, 0F, 0F, 5, 5, ; Shape1.setRotationPoint(-2.5F, 15F, -3F); Shape1.setTextureSize(64, 64); Shape1.mirror = true; setRotation(Shape1, 0F, 0F, 0F); Shape2 = new ModelRenderer(this, 0, 32); Shape2.addBox(0F, 0F, 0F, 1, 2, 1); Shape2.setRotationPoint(-0.5F, 19.7F, 1F); Shape2.setTextureSize(64, 64); Shape2.mirror = true; setRotation(Shape2, -0.3346075F, 0F, 0F); Shape3 = new ModelRenderer(this, 0, 26); Shape3.addBox(0F, 0F, 0F, 1, 1, 4); Shape3.setRotationPoint(-0.5F, 21F, -2.7F); Shape3.setTextureSize(64, 64); Shape3.mirror = true; setRotation(Shape3, 0F, 0F, 0F); Shape4 = new ModelRenderer(this, 0, 19); Shape4.addBox(0F, 0F, 0F, 1, 4, 2); Shape4.setRotationPoint(-0.5F, 19.7F, -3F); Shape4.setTextureSize(64, 64); Shape4.mirror = true; setRotation(Shape4, -0.0743572F, 0F, 0F); Shape5 = new ModelRenderer(this, 0, 42); Shape5.addBox(0F, 0F, 0F, 1, 1, 1); Shape5.setRotationPoint(-0.5F, 14F, 4F); Shape5.setTextureSize(64, 64); Shape5.mirror = true; setRotation(Shape5, 0F, 0F, 0F); Shape6 = new ModelRenderer(this, 0, 45); Shape6.addBox(0F, 0F, 0F, 1, 1, 1); Shape6.setRotationPoint(-0.5F, 14F, -3F); Shape6.setTextureSize(64, 64); Shape6.mirror = true; setRotation(Shape6, 0F, 0F, 0F); Shape7 = new ModelRenderer(this, 0, 48); Shape7.addBox(0F, 0F, 0F, 2, 2, 1); Shape7.setRotationPoint(-1F, 12F, -3F); Shape7.setTextureSize(64, 64); Shape7.mirror = true; setRotation(Shape7, 0F, 0F, 0F); Shape8 = new ModelRenderer(this, 27, 0); Shape8.addBox(0F, 0F, 0F, 1, 1, 6); Shape8.setRotationPoint(-3F, 17F, -3F); Shape8.setTextureSize(64, 64); Shape8.mirror = true; setRotation(Shape8, 0F, 0F, 0F); Shape9 = new ModelRenderer(this, 27, 0); Shape9.addBox(0F, 0F, 0F, 1, 1, 6); Shape9.setRotationPoint(2F, 17F, -3F); Shape9.setTextureSize(64, 64); Shape9.mirror = true; setRotation(Shape9, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Shape1.render(f5); Shape2.render(f5); Shape3.render(f5); Shape4.render(f5); Shape5.render(f5); Shape6.render(f5); Shape7.render(f5); Shape8.render(f5); Shape9.render(f5); } public void renderModel(float f5){ Shape1.render(f5); Shape2.render(f5); Shape3.render(f5); Shape4.render(f5); Shape5.render(f5); Shape6.render(f5); Shape7.render(f5); Shape8.render(f5); Shape9.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } Rendering Class public class RenderLaserArmCannon implements [s]IItemRenderer[/s]{ private ModelLaserArmCannon cannon; public static ResourceLocation texture = new ResourceLocation(Reference.MOD_ID + ":textures/items/laser_arm_cannon_texture.png"); public RenderLaserArmCannon(){ cannon = new ModelLaserArmCannon(); } @Override public boolean handleRenderType(ItemStack item, [s]ItemRenderType[/s] type) { switch(type){ case [s]EQUIPPED[/s]: return true; case [s]EQUIPPED_FIRST_PERSON[/s]: return true; default: return false; } } @Override public boolean shouldUseRenderHelper([s]ItemRenderType[/s] type, ItemStack item, [s]ItemRendererHelper[/s] helper) { return false; } @Override public void renderItem([s]ItemRenderType[/s] type, ItemStack item, Object... data) { switch(type){ case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); this.cannon.renderModel(0.0625F);; GL11.glPopMatrix(); } case [s]EQUIPPED_FIRST_PERSON[/s]: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); boolean isFirstPerson = false; if(data[1] != null && data[1] instanceof EntityPlayer) { if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().getRenderViewEntity() && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative)))) { } else { isFirstPerson = true; } } else { } this.cannon.renderModel(0.0625F);; GL11.glPopMatrix(); } default: break; } } } Line in Main Class MinecraftForgeClient.registerItemRenderer(ModItems.laser_cannon, (IItemRenderer)new RenderLaserArmCannon());
  19. Here's my line in ClientProxy, which appears to be different from you: RenderingRegistry.registerEntityRenderingHandler([Your AI Class].class, new [Mob Model Renderer Class](Minecraft.getMinecraft().getRenderManager(), new [Model Class] (), 0));
  20. I'm trying to change the splash text and menu image on my mod, like how the Dalek Mod does it, but I can't figure it. I've tried creating my own splashes.txt in my assets package and that didn't work. Anyone know how to do this?
  21. Also, if I remove the (boolean) before the world.getBlockstate stuff, it suggests to either add "!= null" after that line or make that line a "if/else".
  22. I've made an item and I've got the code for the item to open an iron door, but it only makes the sound when I right click on the iron door. Here's my code @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { if(!world.isRemote){ if(world.getBlockState(pos).getBlock() instanceof BlockDoor) { String sound; if(world.getBlockState(pos).getValue(BlockDoor.HALF) == EnumDoorHalf.UPPER){ world.setBlockState(pos.down(), world.getBlockState(pos.down()).withProperty(BlockDoor.OPEN, world.getBlockState(pos.down()).getValue(BlockDoor.OPEN))); sound = (Boolean) world.getBlockState(pos.down()).getValue(BlockDoor.OPEN) ? "random.door_close" : "random.door_open"; world.playSoundAtEntity(player, sound, 1.0f, 1.0f); return true; } else { world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockDoor.OPEN, world.getBlockState(pos).getValue(BlockDoor.OPEN))); sound = (Boolean) world.getBlockState(pos).getValue(BlockDoor.OPEN) ? "random.door_close" : "random.door_open"; world.playSoundAtEntity(player, sound, 1.0f, 1.0f); return true; } } } return true; }
×
×
  • Create New...

Important Information

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