Jump to content

DragonITA

Members
  • Posts

    552
  • Joined

  • Last visited

Everything posted by DragonITA

  1. Thanks, i will be leran Java, this is very hard, but one question: why i dont should use the @OnlyIn ????
  2. I am new in Java and Modding. What is a registry entrie? Why? I arleady made this, but i am new and i dont find what i made wrong. Its want a entity type and i have arleady write my entity type, but it have still continue to send me this error message. I tried, but it dont work.
  3. Thanks, i am trying to learn Java. I know a little bit the Heritage of the Java syntax. Here is on how i actualy make my entity (i have tried to find the Init Folder in the Vanilla Code to see hoz i should register my entities, but i cant find it. So I tried to watch a video of HarryTalks with version 1.14.4 to go further. But I get an error, have tried to solve it with my current knowledge, but I can't get it right.) Here is my current Code: package mod.dragonita.fantasymod.entities; import mod.dragonita.fantasymod.init.FantasyModEntities; import net.minecraft.entity.EntityType; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.goal.LookAtGoal; import net.minecraft.entity.ai.goal.LookRandomlyGoal; import net.minecraft.entity.ai.goal.PanicGoal; import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal; import net.minecraft.entity.passive.horse.HorseEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.world.World; public class UnicornEntity extends HorseEntity{ @SuppressWarnings("unchecked") public UnicornEntity(EntityType<? extends HorseEntity> type, World worldIn) { super((EntityType<? extends HorseEntity>) FantasyModEntities.UNICORN_ENTITY, worldIn); } protected void registerGoals() { this.goalSelector.addGoal(1, new PanicGoal(this, 1.2D)); this.goalSelector.addGoal(6, new WaterAvoidingRandomWalkingGoal(this, 0.7D)); this.goalSelector.addGoal(7, new LookAtGoal(this, PlayerEntity.class, 6.0F)); this.goalSelector.addGoal(8, new LookRandomlyGoal(this)); } protected void registerAttributes() { super.registerAttributes(); this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0d); this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(5.0d); } } package mod.dragonita.fantasymod.init; import mod.dragonita.fantasymod.Main; import mod.dragonita.fantasymod.entities.UnicornEntity; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.item.Item; import net.minecraft.item.SpawnEggItem; import net.minecraft.util.ResourceLocation; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; import net.minecraft.world.biome.Biome.SpawnListEntry; import net.minecraftforge.event.RegistryEvent; public class FantasyModEntities { public static EntityType<?> UNICORN_ENTITY = EntityType.Builder.create(UnicornEntity::new, EntityClassification.CREATURE).build(Main.MODID + ":unicorn_entity").setRegistryName(new ResourceLocation(Main.MODID, "unicorn_entity")); public static void registerEntitySpawnEggs(final RegistryEvent.Register<Item> event) { event.getRegistry().registerAll ( ModItems.UNICORN_ENTITY_EGG = registerEntitySpawnEgg(UNICORN_ENTITY, 0xf0f0f0, 0xdf51f5, "unicorn_entity_egg") ); } public static void registerEntityWorldSpawns() { registerEntityWorldSpawn(UNICORN_ENTITY, Biomes.PLAINS, Biomes.JUNGLE, Biomes.BEACH); } public static Item registerEntitySpawnEgg(EntityType<?> type, int color1, int color2, String name) { SpawnEggItem item = new SpawnEggItem(type, color1, color2, new Item.Properties().group(ModItemGroups.RAINBOW_MOD_GROUP)); item.setRegistryName(new ResourceLocation(Main.MODID, name)); return item; } public static void registerEntityWorldSpawn(EntityType<?> entity, Biome... biomes) { for(Biome biome : biomes) { if(biome != null) { biome.getSpawns(entity.getClassification()).add(new SpawnListEntry(entity, 20, 1, 10)); } } } } package mod.dragonita.fantasymod.client.renders; import mod.dragonita.fantasymod.client.models.UnicornEntityModel; import mod.dragonita.fantasymod.entities.UnicornEntity; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.LivingRenderer; import net.minecraft.entity.passive.horse.AbstractHorseEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.client.registry.IRenderFactory; @OnlyIn(Dist.CLIENT) public class UnicornEntityRender extends LivingRenderer<AbstractHorseEntity, UnicornEntityModel> { public UnicornEntityRender(EntityRendererManager manager) { super(manager, new UnicornEntityModel(0f), 0f); } public static final ResourceLocation unicorn = new ResourceLocation("fantasymod:textures/entity/unicorn_entity.png"); public static class RenderFactory implements IRenderFactory<UnicornEntity> { @Override public EntityRenderer<? super UnicornEntity> createRenderFor(EntityRendererManager manager) { return new UnicornEntityRender(manager); } } @Override public ResourceLocation getEntityTexture(AbstractHorseEntity entity) { return unicorn; } } package mod.dragonita.fantasymod.client.models; import net.minecraft.client.renderer.entity.model.HorseModel; import net.minecraft.entity.passive.horse.AbstractHorseEntity; public class UnicornEntityModel extends HorseModel<AbstractHorseEntity> { public UnicornEntityModel(float p_i51065_1_) { super(p_i51065_1_); } } Im have troubles here: package mod.dragonita.fantasymod.client.renders; import mod.dragonita.fantasymod.entities.UnicornEntity; import mod.dragonita.fantasymod.init.FantasyModEntities; import mod.dragonita.fantasymod.init.ModEntities; import net.minecraft.entity.EntityType; import net.minecraft.entity.passive.horse.HorseEntity; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.client.registry.RenderingRegistry; @OnlyIn(Dist.CLIENT) public class FantasyRenderRegistry { @SuppressWarnings("unchecked") public static void registryEntityRenders() { RenderingRegistry.registerEntityRenderingHandler((EntityType<? extends HorseEntity>) FantasyModEntities.UNICORN_ENTITY, new UnicornEntityRender.RenderFactory()); //Here i have my errors message } } I am getting the following error message: The method registerEntityRenderingHandler(EntityType<T>, IRenderFactory<? super T>) in the type RenderingRegistry is not applicable for the arguments (EntityType<capture#2-of ? extends HorseEntity>, UnicornEntityRender.RenderFactory) I already say thank you for all your help.
  4. Hi, sorry for this late reply! I dont know exactly how to Java syntax work if a error was found. Lua Syntax will stop the script (here it is the .class or the .java) if a error was found then the code dont continue and i muss rerun the script in eclipse. This take some time. Ok, why i say this? I say this then i have a Problem with my custom BlockItem. I want first resolve this Problem and then show the code. P.S.: I need a little bit of time to refind the code. Edit: Resolved
  5. Hi, thanks for reading this Topic! I have some troubles with my BlockItem. I followed this CodeSnippet of Cadiboos Github Main Code: @EventBusSubscriber(modid = ExampleMod.MODID, bus = EventBusSubscriber.Bus.MOD) public final class ModEventSubscriber { private static final Logger LOGGER = LogManager.getLogger(ExampleMod.MODID + " Mod Event Subscriber"); /** * This method will be called by Forge when it is time for the mod to register its Blocks. * This method will always be called before the Item registry method. */ @SubscribeEvent public static void onRegisterBlocks(final RegistryEvent.Register<Block> event) { // Register all your blocks inside this registerAll call event.getRegistry().registerAll( // This block has the ROCK material, meaning it needs at least a wooden pickaxe to break it. It is very similar to Iron Ore setup(new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F)), "example_ore"), // This block has the IRON material, meaning it needs at least a stone pickaxe to break it. It is very similar to the Iron Block setup(new Block(Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(5.0F, 6.0F).sound(SoundType.METAL)), "example_block"), // This block has the MISCELLANEOUS material. It is very similar to the Redstone Torch setup(new MiniModelBlock(Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(1.5F).lightValue(13).doesNotBlockMovement()), "mini_model"), // This block has the ROCK material, meaning it needs at least a wooden pickaxe to break it. It is very similar to the Furnace setup(new HeatCollectorBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.5F).lightValue(13)), "heat_collector"), setup(new ElectricFurnaceBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.5F)), "electric_furnace"), setup(new ModFurnaceBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.5F).lightValue(13)), "mod_furnace") ); LOGGER.debug("Registered Blocks"); } /** * This method will be called by Forge when it is time for the mod to register its Items. * This method will always be called after the Block registry method. */ @SubscribeEvent public static void onRegisterItems(final RegistryEvent.Register<Item> event) { final IForgeRegistry<Item> registry = event.getRegistry(); registry.registerAll( // This is a very simple Item. It has no special properties except for being on our creative tab. setup(new Item(new Item.Properties().group(ModItemGroups.MOD_ITEM_GROUP)), "example_item") ); // Automatically register BlockItems for all our Blocks // (We need to go over the entire registry so that we include any potential Registry Overrides) ForgeRegistries.BLOCKS.getValues().stream() // Filter out blocks that aren't from our mod .filter(block -> block.getRegistryName().getNamespace().equals(ExampleMod.MODID)) // You can do extra filtering here if you don't want some blocks to have an BlockItem automatically registered for them // Register the BlockItem for the block .forEach(block -> { // Make the properties, and make it so that the item will be on our ItemGroup (CreativeTab) final Item.Properties properties = new Item.Properties().group(ModItemGroups.MOD_ITEM_GROUP); // Create the new BlockItem with the block and it's properties final BlockItem blockItem = new BlockItem(block, properties); // Setup the new BlockItem with the block's registry name and register it registry.register(setup(blockItem, block.getRegistryName())); }); LOGGER.debug("Registered Items"); } @EventBusSubscriber(modid = ExampleMod.MODID, bus = EventBusSubscriber.Bus.MOD) public final class ModEventSubscriber { private static final Logger LOGGER = LogManager.getLogger(ExampleMod.MODID + " Mod Event Subscriber"); /** * This method will be called by Forge when it is time for the mod to register its Blocks. * This method will always be called before the Item registry method. */ @SubscribeEvent public static void onRegisterBlocks(final RegistryEvent.Register<Block> event) { // Register all your blocks inside this registerAll call event.getRegistry().registerAll( // This block has the ROCK material, meaning it needs at least a wooden pickaxe to break it. It is very similar to Iron Ore setup(new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F)), "example_ore"), // This block has the IRON material, meaning it needs at least a stone pickaxe to break it. It is very similar to the Iron Block setup(new Block(Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(5.0F, 6.0F).sound(SoundType.METAL)), "example_block"), // This block has the MISCELLANEOUS material. It is very similar to the Redstone Torch setup(new MiniModelBlock(Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(1.5F).lightValue(13).doesNotBlockMovement()), "mini_model"), // This block has the ROCK material, meaning it needs at least a wooden pickaxe to break it. It is very similar to the Furnace setup(new HeatCollectorBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.5F).lightValue(13)), "heat_collector"), setup(new ElectricFurnaceBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.5F)), "electric_furnace"), setup(new ModFurnaceBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.5F).lightValue(13)), "mod_furnace") ); LOGGER.debug("Registered Blocks"); } /** * This method will be called by Forge when it is time for the mod to register its Items. * This method will always be called after the Block registry method. */ @SubscribeEvent public static void onRegisterItems(final RegistryEvent.Register<Item> event) { final IForgeRegistry<Item> registry = event.getRegistry(); registry.registerAll( // This is a very simple Item. It has no special properties except for being on our creative tab. setup(new Item(new Item.Properties().group(ModItemGroups.MOD_ITEM_GROUP)), "example_item") ); // Automatically register BlockItems for all our Blocks // (We need to go over the entire registry so that we include any potential Registry Overrides) ForgeRegistries.BLOCKS.getValues().stream() // Filter out blocks that aren't from our mod .filter(block -> block.getRegistryName().getNamespace().equals(ExampleMod.MODID)) // You can do extra filtering here if you don't want some blocks to have an BlockItem automatically registered for them // Register the BlockItem for the block .forEach(block -> { // Make the properties, and make it so that the item will be on our ItemGroup (CreativeTab) final Item.Properties properties = new Item.Properties().group(ModItemGroups.MOD_ITEM_GROUP); // Create the new BlockItem with the block and it's properties final BlockItem blockItem = new BlockItem(block, properties); // Setup the new BlockItem with the block's registry name and register it registry.register(setup(blockItem, block.getRegistryName())); }); LOGGER.debug("Registered Items"); } } My Actualy Code was this: @EventBusSubscriber(modid = ExampleMod.MODID, bus = EventBusSubscriber.Bus.MOD) public final class ModEventSubscriber { private static final Logger LOGGER = LogManager.getLogger(Main.MODID + " Mod Event Subscriber"); /** * This method will be called by Forge when it is time for the mod to register its Blocks. * This method will always be called before the Item registry method. */ @SubscribeEvent public static void onRegisterBlocks(final RegistryEvent.Register<Block> event) { // Register all your blocks inside this registerAll call event.getRegistry().registerAll( // This block has the ROCK material, meaning it needs at least a wooden pickaxe to break it. It is very similar to Iron Ore setup(new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F)), "rainbow_ore"), // This block has the IRON material, meaning it needs at least a stone pickaxe to break it. It is very similar to the Iron Block setup(new Block(Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(5.0F, 6.0F).sound(SoundType.METAL)), "rainbow_block"), ); LOGGER.debug("Registered Blocks"); } /** * This method will be called by Forge when it is time for the mod to register its Items. * This method will always be called after the Block registry method. */ @SubscribeEvent public static void onRegisterItems(final RegistryEvent.Register<Item> event) { final IForgeRegistry<Item> registry = event.getRegistry(); registry.registerAll( // This is a very simple Item. It has no special properties except for being on our creative tab. setup(new Item(new Item.Properties().group(ModItemGroups.MOD_ITEM_GROUP)), "rainbow_ingot") ); // Automatically register BlockItems for all our Blocks // (We need to go over the entire registry so that we include any potential Registry Overrides) ForgeRegistries.BLOCKS.getValues().stream() // Filter out blocks that aren't from our mod .filter(block -> block.getRegistryName().getNamespace().equals(ExampleMod.MODID)) // You can do extra filtering here if you don't want some blocks to have an BlockItem automatically registered for them // Register the BlockItem for the block .forEach(block -> { // Make the properties, and make it so that the item will be on our ItemGroup (CreativeTab) final Item.Properties properties = new Item.Properties().group(ModItemGroups.RAINBOW_MOD_GROUP); // Create the new BlockItem with the block and it's properties final BlockItem blockItem = new BlockItem(block, properties); // Setup the new BlockItem with the block's registry name and register it registry.register(setup(blockItem, block.getRegistryName())); }); LOGGER.debug("Registered Items"); } I first Registred Blocks and then Items, but it still render the Block with the ErrorTexure, the Purple and Black Texture. I dont know how to post my packages here in this Forum to let you view my entiery Mod. Let me say how to make this if you know how to make it!
  6. Sorry for this long offline time, i am sorry! Where can I find a sample code?
  7. Ok, but the Gui? Should i make a new Thread or can i directly ask here, i want obtain the Gui with the Entity in the Middle as 3D Model and 2 or 3 slots for making chest or armor.
  8. ? How to make this? I have see the HorseEntity Code and the AbstractHorseEntity, but i am new and can‘t read how to make a ridable entity. A Code example pls?
  9. Hi, i wonder if i can make a ridable entity/mob but without the HorseEntity class, its possible?
  10. Ok, but how should i register a mob? I think i register on the false way and with false methods.
  11. Pls how to make a mob? Its the same with in the 1.14.4?
  12. I NEED HELP PLS.
  13. The title say all and i can‘t find any tutorial. PLS help me.
  14. Cadiboo, Know you how to make a custom entity in the 1.15.1? I have see, that your Post about the Custom Entity is WIP(Work In Progress [Sorry if you find any misspeled Words]), but know you a Modder that has made a tutorial for the 1.15.1 on how to make a custom entity?
  15. Ok, so I have this question: Between 1.15.0 or 1.15.1 a lot has changed or not? (for example the way to register your items [yes Cabdiboo, I read your tutorial, but I don't notice and wouldn't notice any difference at the moment]).
  16. I think that between the 1.14.4 and the 1.15.0 the code style and others stuf hav changed. I need tutorials like Cabidoo says.
  17. The title say all. How can i make a mod in Minecraft 1.15.0?
  18. I still have this problem, the horse spawns, but with the vanilla texture, not mine. I think I should just imitate the animations and texture, otherwise it will take too long, I'll try, thank you.
  19. Why you resolved it.
  20. Ok, i have tried with making something, and the Unicorn spawn, but without a texture. The model is just like a white Brick it dosent have a texture.
  21. package net.batonfack.fantasymod.client.renders; import net.batonfack.fantasymod.FantasyMod; import net.batonfack.fantasymod.client.models.ModelUnicornWithAbstracHorse; import net.batonfack.fantasymod.client.models.ModelUnicornWitoutAbstracHorse; import net.batonfack.fantasymod.entities.UnicornEntity; import net.minecraft.client.renderer.entity.AbstractHorseRenderer; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.entity.passive.horse.AbstractHorseEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.client.registry.IRenderFactory; @OnlyIn(Dist.CLIENT) public class UnicornEntityRender extends AbstractHorseRenderer<UnicornEntity, ModelUnicornWithAbstracHorse<AbstractHorseEntity>> // <<---The Line with the error { //public UnicornEntityRender(EntityRendererManager manager) { // super(manager, new UnicornEntityModel(0), 0f); //} //private static ModelUnicornWitoutAbstracHorse<UnicornEntity> UnicornModel; public static final ResourceLocation unicorn = new ResourceLocation("fantasymod:" + "textures/entity/unicorn_entity.png"); private static float shadowOpaque = 0.0f; public UnicornEntityRender(EntityRendererManager manager, ModelUnicornWithAbstracHorse<AbstractHorseEntity> UnicornModel, float p_i50961_3_) { super(manager, new ModelUnicornWithAbstracHorse<>(0.0f), p_i50961_3_); } @Override protected ResourceLocation getEntityTexture(UnicornEntity entity) { return unicorn; } public static class RenderFactory implements IRenderFactory<UnicornEntity> { @Override public EntityRenderer<? super UnicornEntity> createRenderFor(EntityRendererManager manager) { return new UnicornEntityRender(manager, new ModelUnicornWithAbstracHorse<>(0.0f), shadowOpaque); } } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.