I've been able to add a CustomBlock and texture it so far; just simple stuff.
Upping the game and I want to start getting that block to interact with other items in the world, so I've gone through the docs and found onBlockPlacedBy, and I have this class.
package com.example.examplemod;
import net.minecraft.core.BlockPos;
import net.minecraft.world.*;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
public class CustomBlock extends Block
{
public CustomBlock()
{
super(BlockBehaviour.Properties.of());
}
@Override
public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack)
{
super.onBlockPlacedBy(world, pos, state, placer, stack);
}
}
All the other imports work correctly, and can find BlockPos, BlockState, LivingEntity, ItemStack but I can't find World.
I've tried letting Eclipse find it, but it can't. I've searched the docs, and I can see it, but not for anything past 1.16.x
This is on 1.20.1, I don't believe it to be an import issue as other Types can be found and the super.onBlockPlacedBy() knows it needs a World type as its first parameter, yet I can't find where onBlockPlacedBy() is implemented in the inheritance tree either...
Any help would be great, I can't seem to find any docs for 1.20.1 that are up to date either.