Jump to content

Recommended Posts

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

Posted
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)

Posted
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,

Posted
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)

Posted (edited)
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)

Posted
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

Posted
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)

Posted

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)

Posted
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

Posted
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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.