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


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by RubyNaxela

  1. @Luis_ST Yup, so I did by translating the OP's message and writing mine in both.
  2. 안녕하세요, kompp. 이 포럼은 자신의 모드를 개발할 때 발생하는 문제에 대한 구체적인 질문을 하기 위한 것입니다. 튜토리얼을 찾고 있다면 인터넷으로 검색해 보세요. 유투브에는 그런 것들이 많이 있어요. 아무도 비행기와 같은 진보된 것들을 만들면서 모딩을 시작하지 않습니다. 첫 블록 또는 아이템을 프로그래밍하는 것부터 시작합니다. 작은 걸음으로 차츰 더 능숙해질 것입니다. 프로그래밍을 잘 배우길 바랍니다. 화이팅~ 추신, 이것은 오히려 영어 포럼입니다. Hello, kompp. This forum is to ask specific questions about problems that arise when developing your own mod. If you're looking for a tutorial, search it on the Internet. There are a lot of things like that on YouTube. Nobody starts modding by making such advanced things as airplanes. Start by programming your first block or item. By small steps, you'll gradually become more skilled. I hope you'll learn programming well. Good luck! P.S. This is rather an English forum.
  3. Thank you all for trying to point me out where to find the source/recomp library, but I know where would it be, it is just not present in my External Libraries list now, when I work with 1.16.1. The only way I can access it is from file explorer. Maybe some configuration error. Anyway, this thread seems to have deviated much from the topic. I wrote a function: public static void giveItemStack(PlayerEntity player, ItemStack stack) { if (!player.addItemStackToInventory(stack)) { player.dropItem(stack, false); } } that now works pretty much the same as the /give command, which is exactly what I wanted. Thanks @Dzuchun for that precious piece of information.
  4. Hello, What's the best approach to adding a custom fluid using DeferredRegister? I did: public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, MODID); then registered it in main class, but I stopped at creating a class that extends net.minecraft.fluid.Fluid. It seems this is not as simple as in the past, when you could just pass the registry name and two resource locations to the superclass... Thanks in advance for any help!
  5. Is this Eclipse? Apparently it has a different initial gradle script than IntelliJ - which I am using. I don't have two forge libraries. I only have one which contains the compiled .jar file. And, yes, I also have client-extra and I use it as well.
  6. Wait a minute... where can I get Minecraft source with javadoc? I've always used the .jar that is included in Forge MDK decompiled with Fernflower whenever I need to take a look at the game code.
  7. Hello, What's the method that checks if player can take a certain stack? Like, if the player has 35.5 full stacks of dirt in their inventory, they still can take a stack of 32 blocks of dirt, but can't take either a stack of 33 dirt or a stack of any amount of cobblestone.
  8. My block class look like this: package ... import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; public class MetalBlock extends Block { public MetalBlock() { super(Block.Properties .create(Material.IRON) .sound(SoundType.METAL) .hardnessAndResistance(5.0f, 6.0f) .harvestLevel(1) .harvestTool(ToolType.PICKAXE) .setRequiresTool() //or func_235861_h_() ); } } and I'm mining it with vanilla tools. I haven't created any tools in my mod yet to test it out. Are you experiencing the problem with vanilla tools?
  9. Thank you for the hint. Although precisely what I need is IFormattableTextComponent#func_240699_a_(TextFormatting). I'm using a version that doesn't have this function mapped yet. EDIT For the most current mapping (20200723 as for today), it's IFormattableTextComponent#mergeStyle(TextFormatting)
  10. Okay, now the event is working with : bus = Mod.EventBusSubscriber.Bus.FORGE But there's one last thing, which is the color. I can't just do: TextFormatting.GRAY + new TranslationTextComponent("desc.diamond.line1") so what's the correct way to do this?
  11. I tried the following: package ... import ... @Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class TooltipHandler { @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public static void addItemToolTip(ItemTooltipEvent event) { ItemStack stack = event.getItemStack(); if (stack.getItem() == Items.DIAMOND) { event.getToolTip().add(new TranslationTextComponent("desc.diamond.line1")); } } ... } But I get no tooltip at all.
  12. Hello, What's the best approach to adding a light gray tooltip to either my mod item or vanilla item? I used to do it with Item.Properties#addInformation(String), but this method won't work for vanilla items. There's a Forge event called ItemTooltipEvent. Will it do the job? How to use it? By the way, I'd like to get the text from the language file. Can I do it with I18n? Actually an example method would be welcome. Thanks in advance for any help!
  13. I'm using MDK version 32.0.75. Found solution: at [1.16.1] [SOLVED] Block drops not respecting harvest level and tooltype
  14. Hello, I've set my mod block harvest tool to pickaxe and level to 1, which should cause it to drop nothing when mined with a wooden pickaxe. However this not only does not take place, but I'm even able to harvest the block by mining it with a bare hand. Code details Block registration: public static final RegistryObject<Block> COPPER_ORE = BLOCKS.register("copper_ore", MetalOreBlock::new); MetalOreBlock class: package ... import ... public class MetalOreBlock extends Block { public MetalOreBlock() { super(Block.Properties .create(Material.ROCK) .sound(SoundType.STONE) .hardnessAndResistance(3.0f, 3.0f) .harvestLevel(1) .harvestTool(ToolType.PICKAXE) ); } } How to fix it? Thanks in advance!
  15. @diesieben07 danke schön. I think you help the best way possible. You don't serve ready solution but make me do some research on my own with a brief couple of words. I appreciate that. But anyway, back to the topic. The problem was indeed with loading the model, but not with the model itself. My blockstate file looked like this: { "variants": { "normal": { "model": "[modid]:sylvite_block" } } } "normal" is not a recognized blockstate anymore and has to be empty. Furthermore, I addressed the model file wrongly. After corrections, it looks like this: { "variants": { "": { "model": "[modid]:block/sylvite_block" } } } And now it works correctly.
  16. Hello, I've decided to update my old mod to 1.16.1 (actually I'm rewriting many things completely due to major changes in code in both Minecraft and Forge). But during the work, I encountered a really stupid problem. Like I said in the title, texture of every block is visible in any item slot, as well as in my hand. However when I place it down, the purple-black checker shows up. What can cause the problem? Code details The block is registered like this: public static final RegistryObject<Block> SYLVITE_BLOCK = BLOCKS.register("sylvite_block", SylviteBlock::new); public static final RegistryObject<Item> SYLVITE_BLOCK_ITEM = ITEMS.register("sylvite_block", () -> new BlockItem(SYLVITE_BLOCK.get())); in registers: public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MoleculeForce.MODID); public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MoleculeForce.MODID); // Executed from main class public static void init() { ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); } models/block/sylvite_block.json { "parent": "block/cube_all", "textures": { "all": "[modid]:blocks/sylvite_block" } } models/item/sylvite_block.json { "parent": "[modid]:block/sylvite_block" } blockstates/sylvite_block.json { "variants": { "normal": { "model": "[modid]:sylvite_block" } } } textures/blocks/sylvite_block.png * exists and is valid if it works for blockitem * Thanks in advance!
  • Create New...

Important Information

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