I am not necessarily new to modding, but I am new to event listeners and events in general. I am making my first mod as a test and I want to make one of my items turn a block into a different block when right clicked on it. Here is my current code:
@Override
public ActionResult<ItemStack> onItemUse(World world, EntityPlayer player, BlockPos pos, EnumHand hand) { System.out.println("CLICKED"); ItemStack itemstack = player.getHeldItem(hand); System.out.println("CLICKED After intemstack"); world.setBlockState(pos, (IBlockState) Blocks.BEDROCK); System.out.println("CLICKED After blockstate"); return new ActionResult(EnumActionResult.PASS, itemstack); }
There is an error when saying that I need to get rid of the @Override or create a method called OnItemUse in either ItemBase or IHasModel
I'm not really sure what to do about the error, so any help is appreciated.
I recently got port forwarding to work, and I tested it with Simple Port Tester from PcWinTech and it tested port 25565 as success, but as soon as my server starts the TCP connection fails. I have looked around the internet, and have not found this problem anywhere.
I am trying to make a server for minecraft, however, I cannot seem to get port forwarding to work. I have tried everything I can think of, and everything I could find on the internet. Nothing I have done works. Someone please help me with this.
Just in case someone needs to know this, I am using AT&T router.
I am helping my brother trying to make a Menger Sponge and he already made it really bug out of sponge, so I need to make the sponge texture transparent. How could I do that, Please help.
I want to make a fluid with a bucket, but can't make it so when you right click on it with a bucket it makes a fuel bucket. If anyone knows how to do this, please tell me how.
when I have a oxygen seal and take my gear off it still says not enough oxygen and it hurts me. if someone has a fix please tell me.
never mind I fixed it, I just closed out of minecraft then came back in.
0
Yeah, all I had to do was .getDefaultState() after Blocks.BEDROCK.
0
I found the problem, I was using ActionResult rather than EnumActionResult that OnItemUse uses.
But now I found out that I cant cast Blocks.BEDROCK to IBlockState...
Man the more problems I fix, the more I find.
0
I am not necessarily new to modding, but I am new to event listeners and events in general. I am making my first mod as a test and I want to make one of my items turn a block into a different block when right clicked on it. Here is my current code:
@Override
public ActionResult<ItemStack> onItemUse(World world, EntityPlayer player, BlockPos pos, EnumHand hand) { System.out.println("CLICKED"); ItemStack itemstack = player.getHeldItem(hand); System.out.println("CLICKED After intemstack"); world.setBlockState(pos, (IBlockState) Blocks.BEDROCK); System.out.println("CLICKED After blockstate"); return new ActionResult(EnumActionResult.PASS, itemstack); }
There is an error when saying that I need to get rid of the @Override or create a method called OnItemUse in either ItemBase or IHasModel
I'm not really sure what to do about the error, so any help is appreciated.
0
Nevermind, looked closer, and it just says port in use.
0
I recently got port forwarding to work, and I tested it with Simple Port Tester from PcWinTech and it tested port 25565 as success, but as soon as my server starts the TCP connection fails. I have looked around the internet, and have not found this problem anywhere.
0
I have some screenshots and if you need anything else just tell me, and I will try to get it.
0
I am not sure how to help you with this, but you should not put your ip address online, people can use that to hack you.
0
I am trying to make a server for minecraft, however, I cannot seem to get port forwarding to work. I have tried everything I can think of, and everything I could find on the internet. Nothing I have done works. Someone please help me with this.
Just in case someone needs to know this, I am using AT&T router.
0
ok thanks anyway
0
I am helping my brother trying to make a Menger Sponge and he already made it really bug out of sponge, so I need to make the sponge texture transparent. How could I do that, Please help.
0
I'm here. I also read it, but I don't have any modding knowledge. The mod would be awesome.
0
Thanks, I will stop using it now.
0
I want to make a fluid with a bucket, but can't make it so when you right click on it with a bucket it makes a fuel bucket. If anyone knows how to do this, please tell me how.
0
never mind I fixed it, I just closed out of minecraft then came back in.