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.

gnosticChemist

Members
  • Joined

  • Last visited

  1. Thanks, it solved. When I see how Flint & Steel put fire I realized that my code doesn't give the flags that the fire need. I still have to verify if the item isn't flying because if is it creates flying fires that sometimes doesn't burn out, but is't work perfectly. Here's the code if anyone is having the same problem: @Override public boolean onEntityItemUpdate(EntityItem entityItem) { BlockPos pos = entityItem.getPosition(); World world = entityItem.world; if(world.isAirBlock(pos) && !world.isAirBlock(pos.down())) { world.setBlockState(entityItem.getPosition(), Blocks.FIRE.getDefaultState(),11); //This line /\ set the fire with the properly flags } return bFull3D; }
  2. I'm trying to do an late game item for my magic mod, it's basically an infinite fuel called Sun Piece. I want to add a feature that when a Sun piece is dropped it set the block on fire, I managed to make the fire appears but there's some weird bugs, it was creating floating fires, also the doesn't burn out and can't hurt mobs. I think that I'm doing something wrong, but since this is my first mod (Not first java) I have no idea. How would I do it properly? Here's Sun Piece class: public class SunPiece extends Item { public SunPiece(){ super(); setUnlocalizedName("sunpiece"); setRegistryName("sunpiece"); setCreativeTab(CreativeTabs.MISC); setMaxStackSize(1); setContainerItem(this); } @Override public int getItemBurnTime(ItemStack itemStack) { return 12800; } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { if(!entityIn.isBurning()) { entityIn.setFire(10); } } @Override public boolean hasCustomEntity(ItemStack stack) { return true; } @Override public Entity createEntity(World world, Entity location, ItemStack itemstack){ EntityItem item = new EntityItem(world, location.posX, location.posY, location.posZ, itemstack) { @Override public boolean isEntityInvulnerable(DamageSource source) { if(source.isFireDamage())return true; return super.isEntityInvulnerable(source); } }; item.motionX = location.motionX; item.motionY = location.motionY; item.motionZ = location.motionZ; item.isAirBorne = true; item.setDefaultPickupDelay(); return item; } @Override public boolean onEntityItemUpdate(EntityItem entityItem) { World world = entityItem.world; if(world.getBlockState(entityItem.getPosition()) == Blocks.AIR.getDefaultState()) { if(world.getBlockState(entityItem.getPosition().down()) != Blocks.AIR.getDefaultState()) if(entityItem.motionZ == 0 && world.getBlockState(entityItem.getPosition()) != Blocks.FIRE.getDefaultState()) world.setBlockState(entityItem.getPosition(), Blocks.FIRE.getDefaultState()); } return bFull3D; } } I'm doing the fire set on metod onEntityItemUpdate()

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.