Started by
DutchAT
on
Topic category: Help with MCreator software
You know that when you are in creative and you click the middle button of your mouse (the wheel) you get the block that you're aiming to.
But, for example, when yo do this in wheat crops, you get seeds, if you do this in potatoes or carrots crops, you'll get carrots or potatoes.
I want to do this last thing. I have a block with custom model and i want to, if you click the wheel while you're aiming this block, you get another block.
For example, if i aim this block, i just want to get Obsidian Block. How can i do this? Thanks everyone
Try:
@SideOnly(Side.CLIENT)
public Item getItem(World worldIn, BlockPos pos)
{
return Item.getItemFromBlock(Blocks.obsidian);
}
@#1 I got this:
:sourceMainJava
C:\Users\---\Desktop\MCreator 1.7.1 [1.10.2] Windows 64bit\forge\build\sources\main\java\mod\mcreator\mcreator_woodenCrate.java:166: error: cannot find symbol
return Item.getItemFromBlock(Blocks.obsidian);
^
symbol: variable obsidian
location: class Blocks
1 error
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 28.101 secs
You are using 1.10.x , right? Then just make all letters in "obsidian" upper case.
@#1.1 Ok, it works. I looked the Forge's Farmland code and i copied it.
I think the problem was that i added another
@SideOnly(Side.CLIENT).
The code now is this one:
@#2 And how can i change the Minecraft Vanilla Block for one of my mod?
it is always something like mcreator_nameOfYourElement.block
@#3 Okay, thanks you so much <3