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

No matter what I set my tool material's attack damage value to, it loads into the game as over 700 attack damage. Any ideas why or is this a bug?

 

ToolMaterialList class

public enum ToolMaterialList implements IItemTier
{
	TUTORIAL(1.7f, 5.0f, 25, 700, 3, ItemList.tutorial_item);
	
	private float attackDamage, efficiency;
	private int enchantability, durability, harvestLevel;
	private Item  repairMaterial;
	
	private ToolMaterialList(float attackDamage, float efficiency, int enchantability, int durability, int harvestLevel, Item repairMaterial)
	{
		this.attackDamage = attackDamage;
		this.efficiency = efficiency;
		this.enchantability = enchantability;
		this.durability = durability;
		this.harvestLevel = harvestLevel;
		this.repairMaterial = repairMaterial;	
	}

	@Override
	public float getAttackDamage() { return this.attackDamage; }

	@Override
	public float getEfficiency() { return this.efficiency; }

	@Override
	public int getEnchantability() { return this.enchantability; }

	@Override
	public int getHarvestLevel() { return this.harvestLevel; }

	@Override
	public int getMaxUses() { return this.durability; }

	@Override
	public Ingredient getRepairMaterial() { return Ingredient.fromItems(repairMaterial); }
}

 

Example of a tool class (they are all the same)

public class ItemTutorialAxe extends ItemAxe
{
	public ItemTutorialAxe(IItemTier tier, Item.Properties properties) 
	{
		super(tier, tier.getMaxUses(), 0, properties);
	}
}

 

What is this "TUTORIAL" at the second line ? Souldn't it be "private ToolMaterialList" instead ?

  • 2 weeks later...

Seems like a Forge bug.

Durability seems to be the Attack damage. 
 

TUTORIAL(1.7f, 5.0f, 25, Attack Damage / not durability at Tools, 3, ItemList.tutorial_item);

To overrun this go to your Registry / properties and add:
 

defaultMaxDamage(700)

 

The ItemAxe constructor takes attack damage as an argument, not durability. You're passing in the durability, so it always ends up being 700.

Edited by TrazorMC

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.