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

Gianka1485

Members
  • Posts

    52
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

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

Gianka1485's Achievements

Stone Miner

Stone Miner (3/8)

1

Reputation

  1. When you want a block to have a texture, it must have the following information (although it may vary): { "parent": "examplemod:block/example_block" }
  2. I was in the bathroom so I couldn't respond quickly, hahaha... I think the problem may come from the .json files of assets /% modid% / models / item
  3. I think you should do it the old way, you should register the item in the items initializer, example: public class GWorldItems { public static final DeferredRegister<Item> ITEMS; public static final RegistryObject<Item> EXAMPLE_DUST; public static final RegistryObject<Item> EXAMPLE_GEM; public static final RegistryObject<Item> EXAMPLE_BLOCK; static { ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "examplemod"); EXAMPLE_DUST = ITEMS.register("example_dust", () -> { return new Item((new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_GEM = ITEMS.register("example_gem", () -> { return new Item((new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_BLOCK = ITEMS.register("example_ore", () -> { return new BlockItem((Block) ExampleBlocks.EXAMPLE_ORE.get(), (new Properties()).tab(ExampleMod.examplemod)); }); } } This is how it has always worked and will always work.
  4. But I remember some mods, which added that type of textures, I think I'll look inside their files, to see how they do it ...
  5. Just in case, the configuration files: The ExampleArmorTiers: public enum ExampleArmorMaterials implements ArmorMaterial { EXAMPLE("example", 200, new int[]{4, 7, 9, 4}, 30, SoundEvents.ARMOR_EQUIP_DIAMOND, 4.0F, 0.2F, () -> { return Ingredient.of(new ItemLike[]{(ItemLike) ExampleItems.EXAMPLE_GEM.get()}); }); private static final int[] baseDurability = new int[]{13, 15, 16, 11}; private final String name; private final int durabilityMultiplier; private final int[] slotProtections; private final int enchantmentValue; private final SoundEvent sound; private final float toughness; private final float knockBackResistance; private final Ingredient repairIngredient; private ExampleArmorMaterials(String name, int durabilityMultiplier, int[] defenseForSlot, int enchantmentValue, SoundEvent equipSound, float toughness, float knockBackResistance, Supplier<Ingredient> repairIngredient) { this.name = name; this.durabilityMultiplier = durabilityMultiplier; this.slotProtections = defenseForSlot; this.enchantmentValue = enchantmentValue; this.sound = equipSound; this.toughness = toughness; this.knockBackResistance = knockBackResistance; this.repairIngredient = (Ingredient) repairIngredient.get(); } public int getDurabilityForSlot(EquipmentSlot slot) { return baseDurability[slot.getIndex()] * this.durabilityMultiplier; } public int getDefenseForSlot(EquipmentSlot slot) { return this.slotProtections[slot.getIndex()]; } public int getEnchantmentValue() { return this.enchantmentValue; } public SoundEvent getEquipSound() { return this.sound; } public Ingredient getRepairIngredient() { return this.repairIngredient; } public String getName() { return ExampleMod.modid + ":" + this.name; } public float getToughness() { return this.toughness; } public float getKnockbackResistance() { return this.knockBackResistance; } } And the ExampleItems: public class ExampleItems { public static final DeferredRegister<Item> ITEMS; public static final RegistryObject<Item> EXAMPLE_DUST; public static final RegistryObject<Item> EXAMPLE_GEM; public static final RegistryObject<Item> EXAMPLE_ORE; public static final RegistryObject<ArmorItem> EXAMPLE_HELMET; public static final RegistryObject<ArmorItem> EXAMPLE_CHESTPLATE; public static final RegistryObject<ArmorItem> EXAMPLE_LEGGINGS; public static final RegistryObject<ArmorItem> EXAMPLE_BOOTS; public static final RegistryObject<AxeItem> EXAMPLE_AXE; public static final RegistryObject<HoeItem> EXAMPLE_HOE; public static final RegistryObject<PickaxeItem> EXAMPLE_PICKAXE; public static final RegistryObject<ShovelItem> EXAMPLE_SHOVEL; public static final RegistryObject<SwordItem> EXAMPLE_SWORD; static { ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "examplemod"); EXAMPLE_DUST = ITEMS.register("example_dust", () -> { return new Item((new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_GEM = ITEMS.register("example_gem", () -> { return new Item((new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_ORE = ITEMS.register("example_ore", () -> { return new BlockItem((Block) ExampleBlocks.EXAMPLE_ORE.get(), (new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_HELMET = ITEMS.register("example_helmet", () -> { return new ArmorItem(ExampleArmorMaterials.EXAMPLE, EquipmentSlot.HEAD, (new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_CHESTPLATE = ITEMS.register("example_chestplate", () -> { return new ArmorItem(ExampleArmorMaterials.EXAMPLE, EquipmentSlot.CHEST, (new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_LEGGINGS = ITEMS.register("example_leggings", () -> { return new ArmorItem(ExampleArmorMaterials.EXAMPLE, EquipmentSlot.LEGS, (new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_BOOTS = ITEMS.register("example_boots", () -> { return new ArmorItem(ExampleArmorMaterials.EXAMPLE, EquipmentSlot.FEET, (new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_AXE = ITEMS.register("example_axe", () -> { return new AxeItem(ExampleTiers.EXAMPLE_TOOL, 5.0F, -3.0F, (new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_HOE = ITEMS.register("example_hoe", () -> { return new HoeItem(ExampleTiers.EXAMPLE_TOOL, -5, 0.0F, (new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_PICKAXE = ITEMS.register("example_pickaxe", () -> { return new PickaxeItem(ExampleTiers.EXAMPLE_TOOL, 1, -2.8F, (new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_SHOVEL = ITEMS.register("example_shovel", () -> { return new ShovelItem(ExampleTiers.EXAMPLE_TOOL, 1.5F, -3.0F, (new Properties()).tab(ExampleMod.examplemod)); }); EXAMPLE_SWORD = ITEMS.register("example_sword", () -> { return new SwordItem(ExampleTiers.EXAMPLE_TOOL, 3, -2.4F, (new Properties()).tab(ExampleMod.examplemod)); }); } }
  6. I made an armor which I want to change color, but when adding the texture, the texture in the game is bugged, not as if there is no texture, and obviously it does not change color, I think it is a problem with the .mcmeta files for animated textures, since if I change the texture to a normal one without animation then it works fine within the game. The .mcmeta files: { "animation": { "frametime": 1, "interpolate": false, "frames": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] } }
  7. I already explained to him in another thread, and he no longer has errors, it seems that they failed to tell him what information to put in "pickaxe.json" ... hahaha
  8. What surprised me the most was that it was using the same code that minecraft vanilla used, and it still crashed.
  9. After doing what diesieben07 said, the problem still continued, so I thought "what if we change the position of the axe variable so that it is not the first to be registered?" and boom, solved ...
  10. But it only happens with the ax, everything else works fine, the sword, the shovel, the pick, the hoe, I'm going to test what you say, see how it goes ...
  11. You must register the name of the object in your lang file, the id of the item and then the translation, example: { "block.examplemod.example_block": "Example block", "item.examplemod.example_item": "Example item", "itemgroup.examplemod": "Example Mod" } These are examples of translating a block, an item and a group of items in creative mode respectively. Lang files are normally named after the language type, for example, for US English it would be en_us.json, for English for England en_uk.json, for Spanish for Spain it would be es_es.json, you can find several examples if you unzip the file from version 1.17.1.jar, in practically the same folder, lang.
  12. I will do that, thank you very much, by the way, did it work?
  13. I'm also a very newbie, my programming knowledge is almost nil (or so it was before), I spent a whole month deciphering how variables, classes, int and float values worked, and other things, and after that, now I understand pretty good most of the code, but it was like 2 weeks trying to make an ore appear in the world, hahaha ... The good thing is that I am someone that if you explain with an example he will understand almost immediately, so I It seems good to explain to others, so that they do not go through the same difficulties that I went through ... haha
×
×
  • Create New...

Important Information

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