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.

wojinwomackacz

Members
  • Joined

  • Last visited

  1. and what if i want to dynamically set the health? i can not simply use a variable with a type double like i did? what is the difference between test(10.0D) and private double doub = 10.0D; test(doub);
  2. hello guys, i have been trying this for couple of hours and i am really stuck. I tried to find some examples from the internet that would be helpfull but nothing helped. So i have my "customEntity" which extends simply EntityZombie . public class EntityTest extends EntityZombie { private double maxHealth = 100.0D; public EntityTest(World par1World) { super(par1World); ((PathNavigateGround)this.getNavigator()).func_179688_b(true); this.tasks.addTask(0, new EntityAISwimming(this)); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxHealth); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); } } this should be really easy and there is nothing i can screw but propably i did.. When i spawn this entity by using my own command which is like: EntityTest entit = new EntityTest(world); entit.setPosition(player.posX+1, player.posY, player.posZ+1); world.spawnEntityInWorld(entit); player.addChatComponentMessage(new ChatComponentText("SUMMON!")); Entity is spawned but it instantly die. But when i change this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxHealth); to this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); it works perfectly.. So i am asking where is the problem and why is this happening and sorry for my English (not everyone is borned at the right place ).

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.