Jump to content

Recommended Posts

Posted

Hey, can somebody pls tell me how to add GrassSeeds?

I tried it with MinecraftForge.addGrassSeed(itemID, metadata, quantity, probability)

but first i don't know what to add under metadata and when i add something like 1 ok 0 or an other int it gives me this error:

 

 

BEGIN ERROR REPORT ee4af955 --------

Generated 18.05.12 18:12

 

Minecraft: Minecraft 1.2.5

OS: Windows Vista (amd64) version 6.0

Java: 1.6.0_29, Sun Microsystems Inc.

VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Sun Microsystems Inc.

LWJGL: 2.4.2

OpenGL: GeForce 9500 GS/PCIe/SSE2 version 3.3.0, NVIDIA Corporation

 

java.lang.NullPointerException

at net.minecraft.src.RenderItem.doRenderItem(RenderItem.java:150)

at net.minecraft.src.RenderItem.doRender(RenderItem.java:526)

at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:189)

at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:176)

at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:431)

at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1094)

at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:903)

at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:869)

at net.minecraft.client.Minecraft.run(Minecraft.java:747)

at java.lang.Thread.run(Unknown Source)

--- END ERROR REPORT cbb2ff50 ----------

 

 

The item I want to add is my potatoseed and I tried it with melonseed too and it gaves me the same error. The Error appears when im hitting grass and if i would become the seed

it crashs.

I don't know how to fix it and im new on Forge modding.

I hope somebody can help me,

Bye :D

 

Ps: Sry for my bad English, i hope you can excuse me. :S

Posted

Remember to +256 your item id, Or, more properly: item.itemID is the value you should use.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

I cant use item.ItemID it says its not applicabel for Item int int int

and it gives me no error with MinecraftForge.addGrassSeed(1015, 0, 1, 20);

only if i hit grass Minecraft crashs I think I have to add a render for my seed or something like that but

no idea how to do this

Posted

Your item.itemID, that is a number, not a item, and it should work fine.

The problem is your item id is not a valid ID hence the null pointer.

Pass in a proper value {using one of the methods I described before}

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Item Etc:

 

public class mod_Food extends BaseMod

{

public static final Item PotatoSeed = new ItemSeedsTextureHandler(386, mod_Food.Potato.blockID, Block.tilledField.blockID).setItemName("PotatoSeed").setIconIndex(8);

 

static {

ModLoader.addName(PotatoSeed, "Potato Seed");

 

public String getVersion()

{

return "1.2.5";}

 

public void load() {

MinecraftForge.addGrassSeed(386,0,1,10);

}

 

 

} }

 

 

ItemSeedsTextureHandler:

 

 

package net.minecraft.src;

 

import net.minecraft.src.forge.ITextureProvider;

 

public class ItemSeedsTextureHandler extends ItemSeeds implements ITextureProvider

 

{

  public ItemSeedsTextureHandler (int par1, int par2, int par3) {

  super(par1,par2,par3);

  }

public String getTextureFile()

    {

            return "/FoodMod/gui/items.png";

    }

 

 

{

 

}

}

 

Posted

Item Etc:

 

public class mod_Food extends BaseMod

{

public static final Item PotatoSeed = new ItemSeedsTextureHandler(386, mod_Food.Potato.blockID, Block.tilledField.blockID).setItemName("PotatoSeed").setIconIndex(8);

 

static {

ModLoader.addName(PotatoSeed, "Potato Seed");

 

public String getVersion()

{

return "1.2.5";}

 

public void load() {

MinecraftForge.addGrassSeed(386,0,1,10);

}

 

 

} }

 

 

ItemSeedsTextureHandler:

 

 

package net.minecraft.src;

 

import net.minecraft.src.forge.ITextureProvider;

 

public class ItemSeedsTextureHandler extends ItemSeeds implements ITextureProvider

 

{

  public ItemSeedsTextureHandler (int par1, int par2, int par3) {

  super(par1,par2,par3);

  }

public String getTextureFile()

    {

            return "/FoodMod/gui/items.png";

    }

 

 

{

 

}

}

 

 

For note, you completely ignored what Lex stated, look at this:

MinecraftForge.addGrassSeed(386,0,1,10);

So you use the shifted itemID of 386, however your item uses this:

public static final Item PotatoSeed = new ItemSeedsTextureHandler(386, mod_Food.Potato.blockID, Block.tilledField.blockID)./*snip*/;

Which is a *non*shifted itemID of 386.

 

As Lex said, you need to use the shifted itemID, either of these will work:

MinecraftForge.addGrassSeed(PotatoSeed.itemID,0,1,10);

MinecraftForge.addGrassSeed(386+256,0,1,10);

 

Remember, Minecraft is stupid with itemIDs, you need to take the stupidity in to account.

  • 2 weeks later...
Posted

Item Etc:

 

public class mod_Food extends BaseMod //if you plan to make it smp change BaseMod to NetworkMod

{

public static final Item PotatoSeed = new ItemSeedsTextureHandler(386, mod_Food.Potato.blockID, Block.tilledField.blockID).setItemName("PotatoSeed").setIconIndex(8);

 

static {

ModLoader.addName(PotatoSeed, "Potato Seed");

 

public String getVersion()

{

return "1.2.5";}

 

public void load() {

MinecraftForge.addGrassSeed(386,0,1,10);

}

 

 

} }

 

 

ItemSeedsTextureHandler:

 

 

package net.minecraft.src;

 

import net.minecraft.src.forge.ITextureProvider;

 

public class ItemSeedsTextureHandler extends ItemSeeds implements ITextureProvider

 

{

  public ItemSeedsTextureHandler (int par1, int par2, int par3) {

  super(par1,par2,par3);

  }

public String getTextureFile()

    {

            return "/FoodMod/gui/items.png";

    }

 

 

{

 

}

}

 

 

 

 

public class mod_Food extends BaseMod

{

public static final Item PotatoSeed = new ItemSeedsTextureHandler(386, mod_Food.Potato.blockID, Block.tilledField.blockID).setItemName("PotatoSeed").setIconIndex(8);

 

static {

ModLoader.addName(PotatoSeed, "Potato Seed");

 

public String getVersion()

{

return "1.2.5";}

 

public void load() {

MinecraftForge.addGrassSeed(PotatoSeed.itemID,0,1,10); //i think its itemID, if not change it to shiftedIndex

}

 

 

} }

 

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Im trying to build my mod using shade since i use the luaj library however i keep getting this error Reason: Task ':reobfJar' uses this output of task ':shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. So i try adding reobfJar.dependsOn shadowJar  Could not get unknown property 'reobfJar' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. my gradle file plugins { id 'eclipse' id 'idea' id 'maven-publish' id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'com.github.johnrengelman.shadow' version '7.1.2' id 'org.spongepowered.mixin' version '0.7.+' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' apply plugin: 'com.github.johnrengelman.shadow' version = mod_version group = mod_group_id base { archivesName = mod_id } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(17) //jarJar.enable() println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { mappings channel: mapping_channel, version: mapping_version copyIdeResources = true runs { configureEach { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' arg "-mixin.config=derp.mixin.json" mods { "${mod_id}" { source sourceSets.main } } } client { // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. property 'forge.enabledGameTestNamespaces', mod_id } server { property 'forge.enabledGameTestNamespaces', mod_id args '--nogui' } gameTestServer { property 'forge.enabledGameTestNamespaces', mod_id } data { workingDirectory project.file('run-data') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') } } } sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { flatDir { dirs './libs' } maven { url = "https://jitpack.io" } } configurations { shade implementation.extendsFrom shade } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation 'org.luaj:luaj-jse-3.0.2' implementation fg.deobf("com.github.Virtuoel:Pehkui:${pehkui_version}") annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' minecraftLibrary 'luaj:luaj-jse:3.0.2' shade 'luaj:luaj-jse:3.0.2' } // Example for how to get properties into the manifest for reading at runtime. tasks.named('jar', Jar).configure { manifest { attributes([ 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors, 'Specification-Version' : '1', // We are version 1 of ourselves 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Vendor' : mod_authors, 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder" : 0, "MixinConfigs" : "derp.mixin.json" ]) } rename 'mixin.refmap.json', 'derp.mixin-refmap.json' } shadowJar { archiveClassifier = '' configurations = [project.configurations.shade] finalizedBy 'reobfShadowJar' } assemble.dependsOn shadowJar reobf { re shadowJar {} } publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } }  
    • Todas as versões do Minecraft Forge são repentinamente tela preta, mesmo sem mods (tentei reinstalar o Minecraft original, Java, atualizar os drivers não funciona)
    • When i join minecraft all ok, when i join world all working fine, but when i open indentity menu, i get this The game crashed whilst unexpected error Error: java.lang.NullPointerException: Cannot invoke "top.ribs.scguns.common.Gun$Projectile.getDamage()" because "this.projectile" is null crash report here https://paste.ee/p/0vKaf
  • Topics

×
×
  • Create New...

Important Information

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