Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

thvardhan

Members
  • Joined

  • Last visited

Everything posted by thvardhan

  1. hello guys i want my block to summon a zombie when its broken. the problem is i cant figure out how to do this. i read vanilla code most of its blocks have this worldIn.spawnEntityInWorld(new EntityXPOrb(worldIn, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 1)); but entityzombie dont take any pos in its constructor. so far this is my code @Override public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) { worldIn.spawnEntityInWorld(new EntityZombie(worldIn));//NOT WORKING super.onBlockDestroyedByPlayer(worldIn, pos, state); } please guide me to how to summon this entity
  2. hello, i am making a entity which is going to attack near players. import net.minecraft.entity.EntityCreature; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIPanic; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public class EntityLeader extends EntityCreature { public EntityLeader(World worldIn) { super(worldIn); tasks.addTask(10, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1D, true)); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); } @Override public boolean isAIDisabled() { return false; } } but this seems to not work. if i remove applyentityattribute method then it starts working but then it doesnt attack any player ( i think because it doesnt have any base atk) and here is my 2nd problem public class EntityLeaderAI extends EntityAIBase{ private EntityLeader leader; public EntityLeaderAI(EntityLeader e) { leader=e; setMutexBits(7); } @Override public boolean shouldExecute() { if(this.leader.getAITarget()!=null && !this.leader.isBurning()) { return true; } else { return false; } } @Override public void startExecuting() { this.leader.attackEntityAsMob(<server type player here>);//how can i get server type player? } } please see the comment in code. thanks for helping.
  3. hello everyone i just updated my forge 1.7.10 to 1.9 and now i want to make a entity in minecraft 1.9. the problem is i never created any entity in 1.7.10 or 1.8. in other words i just dont know where to start making a entity. i need a entity with basic function model will be same as a zombie(biped) since 1.9 is too new i dont think there are any tutorials for that but i heard that minecraft forge 1.8 and 1.9 have almost same code, so can someone recommend me to a good tutorial for making entity? (i dont know anything about entity so please tell me a bit detailed entity tutorial) thanks
  4. here is the thing, i built my mod and now i went to forge directory i shift+clicked there opened a cmd and used gradlew build and got my mod in libs folder. and sorry but what is this MDK? never heard of it.
  5. hello everyone today i exported my mod using gradlew build command and i got my mod in .jar file... but now if i use it with minecraft forge i have few errors (i dint had these errors on IDE) my items AddInformation with colors are changed to something like $%a and colors are not showing. 2nd in some items i had flame particles those are not showing as well while other particles are working fine..there was no bug in eclipse.thanks if someone can help me.
  6. i need to make block update ones 20 ticks i tried world.scheduleblockupdate but it seems not to work. updatetick method get called only ones. is there is any way to make a block update frequently ? if there is please enlighten me.. thanks!
  7. i am trying to make a kind a mining machine and i have a problem that world.setblock sets everything as i need to air but i can still collide with it and restarting game resets every block i saw a post similar to this here http://www.minecraftforge.net/forum/index.php?topic=17694.0 but i cant understand what should i do please take a look here private int click=0; @Override public boolean onBlockActivated(World world, int x,int y, int z, EntityPlayer player,int a, float b, float c,float d) { if(!world.isRemote){ world.playSound(x, y, z, "random.levelup", 1F, 1F, true); click++; System.out.println("click is now "+click); } return super.onBlockActivated(world, x, y,z, player, a, b, c,d); } @SideOnly(Side.CLIENT) @Override public void randomDisplayTick(World world, int x,int y, int z, Random rand) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; Minecraft mc=Minecraft.getMinecraft(); if(click>=10) { click=0; for(int i=0;i<=y;i++) { if(world.getBlock(x,y-i,z)==Blocks.bedrock) { break; } else world.setBlockToAir(x, y-i, z); } } if(click>1) { double XX = (double)x; double YY=(double)y; double ZZ=(double)z; world.spawnParticle("flame", XX+0.55, YY+0.9, ZZ+0.5, 0D, 0D, 0D); world.spawnParticle("flame", XX+0.55, YY+0.9, ZZ+0.5, 0D, 0D, 0D); click++; System.out.println("click now is "+click); } super.randomDisplayTick(world, x, y, z,rand); } public int tickRate() { return 20; }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.