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.

Featured Replies

Posted

Hello, I'm making this mod and I want to give this item special powers to spawn fire at random blocks in a 3x3 radius at the coordinates the player is looking at, here is the code:

 

public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)

{

//itemstack.damageItem(10, entityplayer);

world.playSoundAtEntity(entityplayer, "fire.ignite", 0.7f, 0.8f);

if (!world.isRemote)

{

Vec3 look = entityplayer.getLookVec();

Blocks.fire firemass7 = new Blocks.fire(world, entityplayer, 1, 1, 1);

firemass7.setPosition(

entityplayer.posX + look.xCoord,

entityplayer.posY + look.yCoord,

entityplayer.posZ + look.zCoord);

    world.setBlock(firemass7);

}

return itemstack;

}

 

I am using forge 1.7.10, as I want to make the mod in this version. The problem is that the Blocks.fire can't be resolved to a field, could anyone please let me know how to fix that, or any other mistakes you see in this coding? Thank you.

Guest
This topic is now closed to further replies.

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.