Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Retsal

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Retsal

  • Rank
    Tree Puncher

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Finally I figure out how to solve my last mistake. Thank you so much for your help anyway The sound path must be like this: assets.rsmakeitharder sounds.json sounds heartbeat.ogg
  2. Thank you for your quick response @diesieben07 Now Minecraft doesn't crash, but it is not working. I can't hear any sound after I equip the helmet. Code update for MihArmorMaterial (getSoundEvent is hardcoded for testing propouse): package retsal.rsmakeitharder.common.armor; import java.util.function.Supplier; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.IArmorMaterial; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.SoundEvent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.
  3. Hi I was trying to register my own SoundEvent, and use it when you equip your helmet. MakeItHarder (main class): package retsal.rsmakeitharder; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.
  4. When i wrote the above post it was too late and i just made a working version. So I am going to upload a cleaner version and I hope it helps someone. I don't know when I put it out of the try scope, but it should definitely be inside. I think it is not a public property. Maybe I am wrong, but in 1.16.5-36.0.42 it is coded as private. Below I upload a cleaner version: public class BlockShop extends Block { public BlockShop() { super(AbstractBlock.Properties .create(Material.BARRIER) .hardnessAndResistance(-1) ); } @Override publi
  5. Finally it is working. Thank you so much for the hints and for pointing me to the right direction @Draco18s. I'm going to share a functional version. Although it is not finished, I think it can help someone who has the same issue. public class BlockShop extends Block { public BlockShop() { super(AbstractBlock.Properties .create(Material.BARRIER) .hardnessAndResistance(-1) ); } @Override public ActionResultType onBlockActivated( BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { if (!world.isRemote) { // S
  6. Thanks for your quick response @Draco18s. I have laughed a lot with some of your answers, especially with the webpage where they explained Yoda's if 😂 Updated code: public class BlockShop extends Block { public BlockShop() { super(AbstractBlock.Properties .create(Material.BARRIER) .hardnessAndResistance(-1) ); } @Override public ActionResultType onBlockActivated( BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { BlockState signState = world.getBlockState(pos.down()); if (signState != null) {
  7. Hey, I'm new to minecraft modding, but I know java programming. I am trying to create a custom block that can exchange items when you right click on it, and it gives you the item only if you have enough coins. You will find a picture of the scene attached to this post. Problem: When you right click on the block, it gives you the item if you have enough coins. But if you disconnect and then reconnect to the world, something undoes the changes made by the transaction. I think it happens because I am writing the code on the client side and not updating the information
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.