Jump to content

is there a way to make a mod to give you items that you can't normaly get?


tminor1

Recommended Posts

Hey quick question. In 1.8 mojang did something with the using block and item names in place of the id's and there is now no way to get the smooth double stone slab block. So my question is. Is it possible to make a mod that will give you the smooth double stone slab block?

Link to comment
Share on other sites

I see but how can I create a crafting recipe with the id double_stone_slab:8? It will take the double_stone_slab part but will not take the damage value : 8.

You need to use an ItemStack:

new ItemStack(Blocks.double_stone_slab, 1, ; // put this in the crafting recipe

Arguments are: Item or Block, stack size, damage value.

Link to comment
Share on other sites

Well I thinks it works. Can't tell though because when I go to craft it the game crashes. Some strange rendering issue from what the crash report says for some reason it cat render the item.

 

---- Minecraft Crash Report ----

// I blame Dinnerbone.

 

Time: 6/14/15 4:58 PM

Description: Rendering item

 

java.lang.NullPointerException: Rendering item

at net.minecraft.item.ItemStack.getMetadata(ItemStack.java:235)

at net.minecraft.client.renderer.ItemModelMesher.getMetadata(ItemModelMesher.java:70)

at net.minecraft.client.renderer.ItemModelMesher.getItemModel(ItemModelMesher.java:43)

at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:359)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:410)

at net.minecraft.client.gui.inventory.GuiContainer.drawSlot(GuiContainer.java:267)

at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:99)

at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:448)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1078)

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

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

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85)

at GradleStart.main(GradleStart.java:45)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at net.minecraft.item.ItemStack.getMetadata(ItemStack.java:235)

at net.minecraft.client.renderer.ItemModelMesher.getMetadata(ItemModelMesher.java:70)

at net.minecraft.client.renderer.ItemModelMesher.getItemModel(ItemModelMesher.java:43)

at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:359)

 

-- Item being rendered --

Details:

Item Type: null

Item Aux: ~~ERROR~~ NullPointerException: null

Item NBT: null

Item Foil: ~~ERROR~~ NullPointerException: null

Stacktrace:

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:410)

at net.minecraft.client.gui.inventory.GuiContainer.drawSlot(GuiContainer.java:267)

at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:99)

at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:448)

 

-- Screen render details --

Details:

Screen name: net.minecraft.client.gui.inventory.GuiCrafting

Mouse location: Scaled: (178, 81). Absolute: (356, 317)

Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityPlayerSP['Player567'/175, l='MpServer', x=-232.39, y=68.00, z=139.49]]

Chunk stats: MultiplayerChunkCache: 575, 575

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: -222.00,64.00,153.00 - World: (-222,64,153), Chunk: (at 2,4,9 in -14,9; contains blocks -224,0,144 to -209,255,159), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Level time: 17495 game time, 17495 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 31 total; [EntityMinecartChest['container.minecart'/4, l='MpServer', x=-309.50, y=37.06, z=66.50], EntityBat['Bat'/5, l='MpServer', x=-306.38, y=25.10, z=110.75], EntityPig['Pig'/6, l='MpServer', x=-311.16, y=64.00, z=125.97], EntityRabbit['Rabbit'/137, l='MpServer', x=-155.66, y=85.00, z=205.78], EntityMinecartChest['container.minecart'/74, l='MpServer', x=-232.50, y=40.06, z=114.50], EntityItem['item.tile.dirt.default'/75, l='MpServer', x=-238.25, y=66.00, z=135.13], EntityItem['item.tile.dirt.default'/77, l='MpServer', x=-237.88, y=65.00, z=137.22], EntityRabbit['Rabbit'/78, l='MpServer', x=-229.44, y=63.00, z=208.72], EntityRabbit['Rabbit'/79, l='MpServer', x=-231.56, y=63.00, z=211.19], EntityPig['Pig'/17, l='MpServer', x=-297.19, y=64.00, z=64.88], EntityPlayerSP['Player567'/175, l='MpServer', x=-232.39, y=68.00, z=139.49], EntityPig['Pig'/18, l='MpServer', x=-301.94, y=64.00, z=123.19], EntityBat['Bat'/19, l='MpServer', x=-302.91, y=46.10, z=140.88], EntityBat['Bat'/20, l='MpServer', x=-294.41, y=40.10, z=128.28], EntityPig['Pig'/21, l='MpServer', x=-288.84, y=64.00, z=133.31], EntityRabbit['Rabbit'/92, l='MpServer', x=-217.31, y=63.00, z=213.69], EntityBat['Bat'/31, l='MpServer', x=-287.75, y=45.04, z=82.48], EntityPig['Pig'/32, l='MpServer', x=-278.03, y=64.00, z=137.06], EntityPig['Pig'/33, l='MpServer', x=-285.16, y=64.00, z=136.91], EntityPig['Pig'/34, l='MpServer', x=-284.94, y=64.00, z=139.03], EntityPig['Pig'/35, l='MpServer', x=-275.50, y=64.00, z=145.50], EntityBat['Bat'/104, l='MpServer', x=-195.75, y=31.10, z=113.25], EntityBat['Bat'/105, l='MpServer', x=-174.66, y=30.21, z=111.25], EntityBat['Bat'/106, l='MpServer', x=-214.83, y=24.26, z=213.94], EntityMinecartChest['container.minecart'/45, l='MpServer', x=-261.50, y=33.06, z=63.50], EntityBat['Bat'/112, l='MpServer', x=-181.57, y=30.19, z=118.43], EntityMinecartChest['container.minecart'/48, l='MpServer', x=-266.50, y=39.06, z=77.50], EntityPig['Pig'/49, l='MpServer', x=-267.88, y=64.00, z=64.66], EntityBat['Bat'/50, l='MpServer', x=-271.44, y=47.10, z=96.25], EntityRabbit['Rabbit'/51, l='MpServer', x=-271.66, y=65.00, z=215.50], EntityBat['Bat'/120, l='MpServer', x=-174.25, y=11.10, z=150.59]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:350)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2488)

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

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85)

at GradleStart.main(GradleStart.java:45)

 

-- System Details --

Details:

Minecraft Version: 1.8

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.8.0_31, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 763299776 bytes (727 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94

FML: MCP v9.10 FML v8.0.26.1299 Minecraft Forge 11.14.0.1299 4 mods loaded, 4 mods active

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{8.0.26.1299} [Forge Mod Loader] (forgeSrc-1.8-11.14.0.1299.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{11.14.0.1299} [Minecraft Forge] (forgeSrc-1.8-11.14.0.1299.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

glassDrops{v1.0} [better Glass Drops] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Launched Version: 1.8

LWJGL: 2.9.1

OpenGL: Intel® HD Graphics GL version 3.1.0 - Build 8.15.10.2752, Intel

GL Caps: Using GL 1.3 multitexturing.

Using GL 1.3 texture combiners.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Shaders are available because OpenGL 2.1 is supported.

VBOs are available because OpenGL 1.5 is supported.

 

Using VBOs: Yes

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

 

Link to comment
Share on other sites

package net.testmod.mod;


import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;

@net.minecraftforge.fml.common.Mod(modid = testmod.modid, version = testmod.version, name = testmod.name)
public class main {

public static final String modid = "testmod";
public static final String version = "v1.0";
public static final String name = "Test Mod";

@net.minecraftforge.fml.common.Mod.EventHandler
public void PreInit(net.minecraftforge.fml.common.event.FMLPreInitializationEvent preEvent){

}

@net.minecraftforge.fml.common.Mod.EventHandler
public void Init(net.minecraftforge.fml.common.event.FMLInitializationEvent event){

	GameRegistry.addShapelessRecipe(new ItemStack(Blocks.double_stone_slab, 1, , Blocks.brick_block);

}

@net.minecraftforge.fml.common.Mod.EventHandler
public void PostInit(net.minecraftforge.fml.common.event.FMLPostInitializationEvent PostEvent){

}

}

Link to comment
Share on other sites

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.