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 few tool sets.

It is my ToolAxe class:

package com.H_SerhatY.MoreStrenghtenedToolsMod.items.tools;

import com.H_SerhatY.MoreStrenghtenedToolsMod.Main;
import com.H_SerhatY.MoreStrenghtenedToolsMod.init.ModItems;
import com.H_SerhatY.MoreStrenghtenedToolsMod.util.IHasModel;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemAxe;

public class ToolAxe extends ItemAxe implements IHasModel{

	public ToolAxe(String name, ToolMaterial material)
	{
		super(material, 6.0F, -3.0F);
		
		setUnlocalizedName(name);
		setRegistryName(name);
		setCreativeTab(CreativeTabs.TOOLS);
		
		ModItems.ITEMS.add(this);
	}
	
	@Override
	public void registerModels() 
	{
		Main.proxy.registerItemRenderer(this, 0, "inventory");
	}

}

In the line:

		super(material, 6.0F, -3.0F);

We need to use 2 float value. But I don't want to use values because these values sets all of my axes. I don't want it. I want this system:

Sword: n+3

Axe: n+2

Pickaxe: n+1

Spade(Shovel): n

How can I do it?

My Mods:

More Strenghtened Tools Mod:

https://www.curseforge.com/minecraft/mc-mods/mstm

3 hours ago, H_SerhatY said:

Hello. I'm making few tool sets.

It is my ToolAxe class:


package com.H_SerhatY.MoreStrenghtenedToolsMod.items.tools;

import com.H_SerhatY.MoreStrenghtenedToolsMod.Main;
import com.H_SerhatY.MoreStrenghtenedToolsMod.init.ModItems;
import com.H_SerhatY.MoreStrenghtenedToolsMod.util.IHasModel;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemAxe;

public class ToolAxe extends ItemAxe implements IHasModel{

	public ToolAxe(String name, ToolMaterial material)
	{
		super(material, 6.0F, -3.0F);
		
		setUnlocalizedName(name);
		setRegistryName(name);
		setCreativeTab(CreativeTabs.TOOLS);
		
		ModItems.ITEMS.add(this);
	}
	
	@Override
	public void registerModels() 
	{
		Main.proxy.registerItemRenderer(this, 0, "inventory");
	}

}

In the line:


		super(material, 6.0F, -3.0F);

We need to use 2 float value. But I don't want to use values because these values sets all of my axes. I don't want it. I want this system:

Sword: n+3

Axe: n+2

Pickaxe: n+1

Spade(Shovel): n

How can I do it?

Pass different values into ththe constructor?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

public class BasicToolPrefabAxe extends ItemAxe implements IHasModel
{

    public BasicToolPrefabAxe(String name,ToolMaterial material,String tool,int level,float AttackDamage,float AttackSpeed,int SetMaxStackSize)
    {
        super(material, AttackDamage, AttackSpeed);
        setUnlocalizedName(name);
        setRegistryName(name);
        setCreativeTab(CreativeTabs.TOOLS);
        setHarvestLevel(tool,level);
        setMaxStackSize(SetMaxStackSize);

        BasicItemRegistry.ITEMS.add(this);
    }
    public void registerModels(){UTOMod.proxy.registerItemRenderer(this, 0, "inventory");}
}

in the first set of values, your setting the values that can be changed in other classes,

9 hours ago, H_SerhatY said:

In the line:


		super(material, 6.0F, -3.0F);

We need to use 2 float value. But I don't want to use values because these values sets all of my axes. I don't want it. I want this system:

Sword: n+3

Axe: n+2

Pickaxe: n+1

Spade(Shovel): n

How can I do it?

In this, what is n?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

1 minute ago, H_SerhatY said:

Any value(in numbers).

So a random number?

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author
11 minutes ago, Cadiboo said:

So a random number?

No. For example, if I set n to 12, my tools' attack damage going to set like this;

Sword: 15

Axe: 14(in previous versions, it's going to set like this.)

Pickaxe: 13

Shovel: 12

I want to say this. 

Edited by H_SerhatY

My Mods:

More Strenghtened Tools Mod:

https://www.curseforge.com/minecraft/mc-mods/mstm

  • Author
19 minutes ago, Cadiboo said:

So a random number?

I want to say this...

public static final ToolMaterial MATERIAL_REINFORCED_EMERALD_MK4 = EnumHelper.addToolMaterial("material_reinforced_emerald_mk4", 219, 127544, 751.0F, 425.0F, 961);

This is my tool material. In second FLOAT value, we're set an attack damage.

It's set to 425.0F so my sword's attack damage is set to 429.

And I want my axe's attack damage is set to 428.

And another example:

public static final ToolMaterial MATERIAL_REINFORCED_IRON_INGOT_MK4 = EnumHelper.addToolMaterial("material_reinforced_iron_ingot_mk4", 29, 3269, 76.0F, 72.0F, 184);

This is my other tool material(I have a lot of this.). In second FLOAT value, we're set an attack damage.

It's set to 72.0F so my sword's attack damage is set to 76.

And I want my axe's attack damage is set to 75.

Do you understand?

 

My Mods:

More Strenghtened Tools Mod:

https://www.curseforge.com/minecraft/mc-mods/mstm

1 minute ago, H_SerhatY said:

I want to say this...


public static final ToolMaterial MATERIAL_REINFORCED_EMERALD_MK4 = EnumHelper.addToolMaterial("material_reinforced_emerald_mk4", 219, 127544, 751.0F, 425.0F, 961);

This is my tool material. In second FLOAT value, we're set an attack damage.

It's set to 425.0F so my sword's attack damage is set to 429.

And I want my axe's attack damage is set to 428.

And another example:


public static final ToolMaterial MATERIAL_REINFORCED_IRON_INGOT_MK4 = EnumHelper.addToolMaterial("material_reinforced_iron_ingot_mk4", 29, 3269, 76.0F, 72.0F, 184);

This is my other tool material(I have a lot of this.). In second FLOAT value, we're set an attack damage.

It's set to 72.0F so my sword's attack damage is set to 76.

And I want my axe's attack damage is set to 75.

Do you understand?

 

I think so, whats wrong with that code?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

why not just pass n in the constructor?

 

public ToolAxe(String name, ToolMaterial material, int n)
	{
		super(material, 6.0F + n, -3.0F + n);
		
		setUnlocalizedName(name);
		setRegistryName(name);
		setCreativeTab(CreativeTabs.TOOLS);
		
		ModItems.ITEMS.add(this);
	}

 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author
1 minute ago, Cadiboo said:

why not just pass n in the constructor?

 


public ToolAxe(String name, ToolMaterial material, int n)
	{
		super(material, 6.0F + n, -3.0F + n);
		
		setUnlocalizedName(name);
		setRegistryName(name);
		setCreativeTab(CreativeTabs.TOOLS);
		
		ModItems.ITEMS.add(this);
	}

 

I will try it.

My Mods:

More Strenghtened Tools Mod:

https://www.curseforge.com/minecraft/mc-mods/mstm

  • Author
2 minutes ago, Cadiboo said:

why not just pass n in the constructor?

 


public ToolAxe(String name, ToolMaterial material, int n)
	{
		super(material, 6.0F + n, -3.0F + n);
		
		setUnlocalizedName(name);
		setRegistryName(name);
		setCreativeTab(CreativeTabs.TOOLS);
		
		ModItems.ITEMS.add(this);
	}

 

It's caused an error in ModItems class. And it's want to delete the n parameter.

My Mods:

More Strenghtened Tools Mod:

https://www.curseforge.com/minecraft/mc-mods/mstm

  • Author

This is my axe item:

public static final ItemAxe REINFORCED_EMERALD_MK4_AXE = new ToolAxe("reinforced_emerald_mk4_axe", MATERIAL_REINFORCED_EMERALD_MK4);

In there:

new ToolAxe("reinforced_emerald_mk4_axe", MATERIAL_REINFORCED_EMERALD_MK4);

It wants to add the n parameter to there or delete it from ToolAxe class.

My Mods:

More Strenghtened Tools Mod:

https://www.curseforge.com/minecraft/mc-mods/mstm

8 minutes ago, H_SerhatY said:

This is my axe item:


public static final ItemAxe REINFORCED_EMERALD_MK4_AXE = new ToolAxe("reinforced_emerald_mk4_axe", MATERIAL_REINFORCED_EMERALD_MK4);

In there:


new ToolAxe("reinforced_emerald_mk4_axe", MATERIAL_REINFORCED_EMERALD_MK4);

It wants to add the n parameter to there or delete it from ToolAxe class.

then add the n parameter?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.