terraya
Members-
Posts
161 -
Joined
-
Last visited
Everything posted by terraya
-
thanks i will try it
-
hmm i prefer to give him an "itemSword" to use and "onleftclick" it does its effect .... isnt that normaly working?
-
Hello@All, i got a small problem, i got the mod "CustomNPCs" , i created a custom sword which cause "FireDamage" and when i give the sword to the NPC to use, when he hits the enemy he dont get the "caused damage by the sword + firedamage isnt there" , so well the "Sword" dont cause anything ... it is just there as "Dekoration" , so is it my error or just a custom entity cant use a sword with hes abilities? i mean, i would create easy and custom human and give him the weapon in hes hand, but will it cause the damage given by the sword etc...?
-
im sorry, heres the right one: ---- Minecraft Crash Report ---- // But it works on my machine. Time: 17.11.16 00:52 Description: Ticking entity java.lang.NullPointerException: Ticking entity at DevilFruitSkills.IceBall.changeToIce(IceBall.java:61) at DevilFruitSkills.IceBall.onImpact(IceBall.java:94) at net.minecraft.entity.projectile.EntityThrowable.onUpdate(EntityThrowable.java:266) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2108) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:873) at net.minecraft.world.World.updateEntity(World.java:2075) at net.minecraft.world.World.updateEntities(World.java:1888) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:645) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:783) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) at java.lang.Thread.run(Unknown Source)
-
Hello@All .. everything works fine ... if i want to throw and entity on the other entity and make it explode .. it work perfectly ... but if i want to hit an entity with another entity AND change the ground to ICE it wont work ... i get an error .. hopefully someone can help me EntityClass: public class IceBall extends EntityThrowable { public IceBall(World par1World) { super(par1World); } public IceBall(World par1World, EntityPlayer par3EntityPlayer) { super(par1World, par3EntityPlayer); } public IceBall(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } public int explosionRadius = 5; public int ticks = 300; public void onEntityUpdate() { if (this.ticks <= 0) { this.ticks = 300; setDead(); } else { this.ticks -= 1; } } public int quantityDropped(Random random) { return 0; //Returns 0 item drop on destruction } public void changeToIce(BlockPos location, int radius) { for (int x = location.getX() - radius; x <= location.getX() + radius; x++) { for (int y = location.getY() - radius; y <= location.getY() + radius; y++) { for (int z = location.getZ() - radius; z <= location.getZ() + radius; z++) { BlockPos pos = new BlockPos(x, y, z); if (pos.distanceSq(location) <= radius) { IBlockState blockState = worldObj.getBlockState(pos); if (blockState != Blocks.AIR .getDefaultState()) { worldObj.setBlockState(pos, CustomBlocks.IceBlock1.getDefaultState()); } } } } } } @Override protected void onImpact(RayTraceResult result) { if (result.entityHit != null) { int i = 0; if (result.entityHit instanceof EntityLivingBase) { i = 150; } result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)i); worldObj.playSound((EntityPlayer)null, posX, posY, posZ, SoundEvents.BLOCK_GRASS_BREAK, SoundCategory.NEUTRAL, 0.8F, 1.5F / (worldObj.rand.nextFloat() * 0.4F + 0.8F)); } for (int j = 0; j < 8; ++j) { this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, this.explosionRadius, true); changeToIce(result.getBlockPos(), 100); } if (!this.worldObj.isRemote) { this.setDead(); worldObj.playSound((EntityPlayer)null, posX, posY, posZ, SoundEvents.BLOCK_GRASS_BREAK, SoundCategory.NEUTRAL, 0.7F, 1.5F / (worldObj.rand.nextFloat() * 0.4F + 0.8F)); } } protected float getGravityVelocity() { return 0.001F; } } ErrorLog: ---- Minecraft Crash Report ---- // Quite honestly, I wouldn't worry myself about that. Time: 17.11.16 00:40 Description: Ticking entity java.lang.Error: Unresolved compilation problem: The type IceBall must implement the inherited abstract method EntityThrowable.onImpact(RayTraceResult) at DevilFruitSkills.IceBall.onImpact(IceBall.java:22) at net.minecraft.entity.projectile.EntityThrowable.onUpdate(EntityThrowable.java:266) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2108) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:873) at net.minecraft.world.World.updateEntity(World.java:2075) at net.minecraft.world.World.updateEntities(World.java:1888) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:645) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:783) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) at java.lang.Thread.run(Unknown Source)
-
just tryed to extend a normal block with: @Override public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) { return NULL_AABB; } it does work to "jump" into the block from "above" but from the sites it block me .. well anyways, i removed some functionalitys from "BlockBush" , so it work as i wanted already. thanks@All!
-
tried it already but its not working, or i maybe tried it wrong x), anyways, thanks!
-
anyways ... after watching MORE and MORE through the vanilla code... as diesieben sayd ... its here : /** * How many world ticks before ticking */ public int tickRate(World worldIn) { return 30; } public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { if (worldIn.getGameRules().getBoolean("doFireTick")) { if (!this.canPlaceBlockAt(worldIn, pos)) { worldIn.setBlockToAir(pos); } Block block = worldIn.getBlockState(pos.down()).getBlock(); boolean flag = block.isFireSource(worldIn, pos.down(), EnumFacing.UP); int i = ((Integer)state.getValue(AGE)).intValue(); if (!flag && worldIn.isRaining() && this.canDie(worldIn, pos) && rand.nextFloat() < 0.2F + (float)i * 0.03F) { worldIn.setBlockToAir(pos); } else { if (i < 15) { state = state.withProperty(AGE, Integer.valueOf(i + rand.nextInt(3) / 2)); worldIn.setBlockState(pos, state, 4); } worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn) + rand.nextInt(10)); if (!flag) { if (!this.canNeighborCatchFire(worldIn, pos)) { if (!worldIn.getBlockState(pos.down()).isSideSolid(worldIn, pos.down(), EnumFacing.UP) || i > 3) { worldIn.setBlockToAir(pos); } return; } if (!this.canCatchFire(worldIn, pos.down(), EnumFacing.UP) && i == 15 && rand.nextInt(4) == 0) { worldIn.setBlockToAir(pos); return; } } boolean flag1 = worldIn.isBlockinHighHumidity(pos); int j = 0; if (flag1) { j = -50; } this.tryCatchFire(worldIn, pos.east(), 300 + j, rand, i, EnumFacing.WEST); this.tryCatchFire(worldIn, pos.west(), 300 + j, rand, i, EnumFacing.EAST); this.tryCatchFire(worldIn, pos.down(), 250 + j, rand, i, EnumFacing.UP); this.tryCatchFire(worldIn, pos.up(), 250 + j, rand, i, EnumFacing.DOWN); this.tryCatchFire(worldIn, pos.north(), 300 + j, rand, i, EnumFacing.SOUTH); this.tryCatchFire(worldIn, pos.south(), 300 + j, rand, i, EnumFacing.NORTH); for (int k = -1; k <= 1; ++k) { for (int l = -1; l <= 1; ++l) { for (int i1 = -1; i1 <= 4; ++i1) { if (k != 0 || i1 != 0 || l != 0) { int j1 = 100; if (i1 > 1) { j1 += (i1 - 1) * 100; } BlockPos blockpos = pos.add(k, i1, l); int k1 = this.getNeighborEncouragement(worldIn, blockpos); if (k1 > 0) { int l1 = (k1 + 40 + worldIn.getDifficulty().getDifficultyId() * 7) / (i + 30); if (flag1) { l1 /= 2; } if (l1 > 0 && rand.nextInt(j1) <= l1 && (!worldIn.isRaining() || !this.canDie(worldIn, blockpos))) { int i2 = i + rand.nextInt(5) / 4; if (i2 > 15) { i2 = 15; } worldIn.setBlockState(blockpos, state.withProperty(AGE, Integer.valueOf(i2)), 3); } } } } } } } } }
-
as written above, i extend "BlockBush" becouse its has to be a block where you should be able to walk through
-
i have found what you mean: my code looks now like this, but somehow it still doesnt work .. x-x public class BlockUpdateFireBlockClass extends BlockBush{ public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); public BlockUpdateFireBlockClass (String name,int light, Material materialIn){ super (materialIn); this.setBlockUnbreakable(); this.setLightLevel(light); this.setUnlocalizedName(name); this.setTickRandomly(true); } @SideOnly(Side.CLIENT) @Override public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.TRANSLUCENT; } @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { entityIn.attackEntityFrom(DamageSource.cactus, 5.0F); entityIn.setFire(10); } /** * Convert the given metadata into a BlockState for this Block */ public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta)); } /** * Convert the BlockState into the correct metadata value */ public int getMetaFromState(IBlockState state) { return ((Integer)state.getValue(AGE)).intValue(); } protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {AGE}); } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public boolean isFullCube(IBlockState state) { return false; } @Override public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) { return NULL_AABB; } public int quantityDropped(Random random) { return 0; //Returns 0 item drop on destruction } @Override public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { IBlockState soil = worldIn.getBlockState(pos.down()); return super.canPlaceBlockAt(worldIn, pos) && soil.getBlock().canSustainPlant(soil, worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this); } @Override protected boolean canSustainBush(IBlockState state) { return true; } @Override public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) { if (state.getBlock() == this) { IBlockState soil = worldIn.getBlockState(pos.down()); return soil.getBlock().canSustainPlant(soil, worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this); } return this.canSustainBush(worldIn.getBlockState(pos.down())); } protected boolean canDie(World worldIn, BlockPos pos) { return worldIn.isRainingAt(pos) || worldIn.isRainingAt(pos.west()) || worldIn.isRainingAt(pos.east()) || worldIn.isRainingAt(pos.north()) || worldIn.isRainingAt(pos.south()); } public boolean requiresUpdates() { return false; } }
-
public void onBlockUpdate() { if (this.ticks <= 0) { this.ticks = 15; //DeleteBlock } else { this.ticks -= 1; } }
-
it look harder then it is ... bcuz i see additional functions like "canCatchFire" etc and im not so hard into coding ... i mean, i learned all i know by small tutorials (only minecraft) :3
-
hmm sound a bit hard, isnt it? i was thinking about "Fire" ... i want to take a look on how it work/look like .. :3 becouse it disappear after couple of seconds too so maybe there is an easyer way ?
-
Hello@All , im asking myself, what would be the function if i would set a block, and after 20sec it should get deleted. world.setBlockState(new BlockPos(x +1, y +1, z +1), Blocks.GLASS.getDefaultState()); and to delete i would use worldIn.destroyBlock(pos, true); but how to make a delay?
-
AND, how to remove and existing block after 20sec for example ... i mean like fire, when i set the block, it goes away after 20sec.
-
ok got it, just need now the "FireSound"
-
"BlockBush" Work perfectly, thank you very much! last question is, i want to make instead a "FireEntity" a "FireBlock" , is there any way to add sound/Firedamage on the block? i mean, "Cactus" is doing damage on touching it , so i would search for customcactus and change the normal damage to "firedamage" right? and the sound, im sure there is a function for
-
alright, well im searching for the "Vamilla" code for "Clouds" ... i tryed to extend my class to "BlockCloud" but there is none now i gtg to work. hopefully i get an answer until then thanks anyway!
-
Hello Dear Forum, i would like to as me ... how can i make an "Walkthroughable Block" ... i mean , this here is a normal block class: public class BlockUpdateClass extends Block { public BlockUpdateClass(Material materialIn) { super(materialIn); this.setUnlocalizedName(getLocalizedName()); this.setCreativeTab(CreativeTabs.MATERIALS); } } is there any function which makes that what i would like to ?
-
a bit late but couldnt work much on it bcuz of work - well anyways, i changed the two "same named classes" ... - i register my entities now in the "preInit" - registerEntityHandler , i just removed the function, first wanna try to make it work then after i will try to fix this one - im using getObjectID bcuz i want to remove "CraftingTable" from the list. still wont work heres my main class: @Mod(modid = "BlockUpdate", name="BlockUpdate Mod", version="3.0", acceptedMinecraftVersions="[1.10.2]") public class BlocksUpdate { @SidedProxy(clientSide="ArturFarid.BlockUpdate.proxy.ClientProxy", serverSide="ArturFarid.BlockUpdate.proxy.CommonProxy") public static CommonProxy proxy; public static Item_Tab item_tab = new Item_Tab(); public static Sword_Tab sword_tab = new Sword_Tab(); public static Food_Tab food_tab = new Food_Tab(); public static Devil_Fruit_Tab devil_fruit_tab = new Devil_Fruit_Tab(); @Instance public static BlocksUpdate instance; @EventHandler public void preInit(FMLPreInitializationEvent event) { ArturFarid.BlockUpdate.init.CustomBlocks.init(); ArturFarid.BlockUpdate.init.CustomBlocks.register(); ItemsUpdate.init(); ItemsUpdate.register(); //DEVIL FRUIT SKILLS EntityRegistry.registerModEntity(ThrowableEntity.class, "Test", 11, this, 80, 3, true); EntityRegistry.registerModEntity(IceArrow.class, "IceArrow", 10, this, 80, 3, true); EntityRegistry.registerModEntity(IceAge.class, "IceAge", 9, this, 80, 3, true); EntityRegistry.registerModEntity(IceBall.class, "IceBall", 8, this, 80, 3, true); EntityRegistry.registerModEntity(IceWall.class, "IceWall", 7, this, 80, 3, true); EntityRegistry.registerModEntity(FireBall.class, "FireBall", 6, this, 80, 3, true); EntityRegistry.registerModEntity(BigFireBall.class, "BigFireBall", 5, this, 80, 3, true); EntityRegistry.registerModEntity(PawHit.class, "PawHit", 4, this, 80, 3, true); EntityRegistry.registerModEntity(UrsusShock.class, "UrsusShock", 3, this, 80, 3, true); EntityRegistry.registerModEntity(Volt1Billion.class, "TestThrowable", 2, this, 80, 3, true); //DEVIL FRUIT SWORDS SKILLS EntityRegistry.registerModEntity(ChainLightningEntity.class, "BlockUpdateSwordClass", 1, this, 80, 3, true); EntityRegistry.registerModEntity(EntityModelTest.class, "EntityModelTest", 19, BlocksUpdate.instance, 64, 20, true); EntityRegistry.registerEgg(EntityModelTest.class, 0xFF00, 0xFF00); EntityRegistry.addSpawn(EntityModelTest.class, 5, 1, 10, EnumCreatureType.MONSTER, Biome.getBiome(1)); EntityRegistry.registerModEntity(EntityModelBall.class, "EntityModelBall", 21, BlocksUpdate.instance, 64, 20, true); EntityRegistry.registerEgg(EntityModelBall.class, 0xFF00, 0xFF00); EntityRegistry.addSpawn(EntityModelBall.class, 5, 1, 10, EnumCreatureType.MONSTER, Biome.getBiome(1)); } @EventHandler public void Init(FMLInitializationEvent event) { proxy.registeRenders(); /* REMOVING CRAFTING TABLE */ Collection<Item> removeSet = new HashSet(); Collections.addAll(removeSet, new Item[] { Item.REGISTRY.getObjectById(58) } ); Iterator<IRecipe> iterator1 = CraftingManager.getInstance().getRecipeList().iterator(); while (iterator1.hasNext()) { IRecipe recipe = iterator1.next(); if (recipe == null) continue; ItemStack output = recipe.getRecipeOutput(); if (output != null && output.getItem() != null && removeSet.contains(output.getItem())) iterator1.remove(); } } @EventHandler public void postInit(FMLPostInitializationEvent event) {} } the weird thing about is that my "TestNpcs" are spawning (which are not throwingentities) , i tryed to make it even on "leftclick" but it dont work either so the entites dont wanna spawn ..
-
still sadly dont work but actualy my "TEST NPCs" are spawning @Mod(modid = "BlockUpdate", name="BlockUpdate Mod", version="3.0", acceptedMinecraftVersions="[1.10.2]") public class BlocksUpdate { @SidedProxy(clientSide="ArturFarid.BlockUpdate.proxy.ClientProxy", serverSide="ArturFarid.BlockUpdate.proxy.CommonProxy") public static CommonProxy proxy; public static Item_Tab item_tab = new Item_Tab(); public static Sword_Tab sword_tab = new Sword_Tab(); public static Food_Tab food_tab = new Food_Tab(); public static Devil_Fruit_Tab devil_fruit_tab = new Devil_Fruit_Tab(); @Instance public static BlocksUpdate instance; @EventHandler public void preInit(FMLPreInitializationEvent event) { ArturFarid.BlockUpdate.init.BlocksUpdate.init(); ArturFarid.BlockUpdate.init.BlocksUpdate.register(); ItemsUpdate.init(); ItemsUpdate.register(); } @EventHandler public void Init(FMLInitializationEvent event) { proxy.registeRenders(); EntityRegistry.registerModEntity(EntityModelTest.class, "EntityModelTest", 19, BlocksUpdate.instance, 64, 20, true); EntityRegistry.registerEgg(EntityModelTest.class, 0xFF00, 0xFF00); EntityRegistry.addSpawn(EntityModelTest.class, 5, 1, 10, EnumCreatureType.MONSTER, Biome.getBiome(1)); EntityRegistry.registerModEntity(EntityModelBall.class, "EntityModelBall", 21, BlocksUpdate.instance, 64, 20, true); EntityRegistry.registerEgg(EntityModelBall.class, 0xFF00, 0xFF00); EntityRegistry.addSpawn(EntityModelBall.class, 5, 1, 10, EnumCreatureType.MONSTER, Biome.getBiome(1)); RenderingRegistry.registerEntityRenderingHandler(EntityModelTest.class, new RenderModelTest()); RenderingRegistry.registerEntityRenderingHandler(EntityModelBall.class, new RenderModelBall()); RenderingRegistry.registerEntityRenderingHandler(EntityDragonTest.class, new RenderDragonTest()); //DEVIL FRUIT SKILLS RenderManager rm = Minecraft.getMinecraft().getRenderManager(); EntityRegistry.registerModEntity(IceArrow.class, "IceArrow", 10, this, 80, 3, true); EntityRegistry.registerModEntity(IceAge.class, "IceAge", 9, this, 80, 3, true); EntityRegistry.registerModEntity(IceBall.class, "IceBall", 8, this, 80, 3, true); EntityRegistry.registerModEntity(IceWall.class, "IceWall", 7, this, 80, 3, true); EntityRegistry.registerModEntity(FireBall.class, "FireBall", 6, this, 80, 3, true); EntityRegistry.registerModEntity(BigFireBall.class, "BigFireBall", 5, this, 80, 3, true); EntityRegistry.registerModEntity(PawHit.class, "PawHit", 4, this, 80, 3, true); EntityRegistry.registerModEntity(UrsusShock.class, "UrsusShock", 3, this, 80, 3, true); EntityRegistry.registerModEntity(Volt1Billion.class, "TestThrowable", 2, this, 80, 3, true); //DEVIL FRUIT SWORDS SKILLS EntityRegistry.registerModEntity(ChainLightningEntity.class, "BlockUpdateSwordClass", 1, this, 80, 3, true); RenderingRegistry.registerEntityRenderingHandler(PawHit.class, new ThrowableBlockRender(rm, ArturFarid.BlockUpdate.init.BlocksUpdate.planks1,Minecraft.getMinecraft().getRenderItem())); RenderingRegistry.registerEntityRenderingHandler(BigFireBall.class, new RenderApple(rm, ItemsUpdate.yoru, Minecraft.getMinecraft().getRenderItem())); /* REMOVING CRAFTING TABLE */ Collection<Item> removeSet = new HashSet(); Collections.addAll(removeSet, new Item[] { Item.REGISTRY.getObjectById(58) } ); Iterator<IRecipe> iterator1 = CraftingManager.getInstance().getRecipeList().iterator(); while (iterator1.hasNext()) { IRecipe recipe = iterator1.next(); if (recipe == null) continue; ItemStack output = recipe.getRecipeOutput(); if (output != null && output.getItem() != null && removeSet.contains(output.getItem())) iterator1.remove(); } } @EventHandler public void postInit(FMLPostInitializationEvent event) {} }