Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

urabaros

Members
  • Joined

  • Last visited

Everything posted by urabaros

  1. Hello! I'm trying to create a grass block, using json's "parent": "block/cross", but it works incorrectly. What have I done wrong? BLOCK MODEL: { "parent": "block/cross", "textures": { "cross": "examplemod:block/example_sapling", "particle": "examplemod:block/example_sapling" } } BLOCKSTATE: { "variants": { "": { "model": "examplemod:block/example_sapling" } } } BlockItem is working, so textures are on the right place.
  2. Hello! I don't know why, but my block doesn't work in the game. It is registered in the game, but textures are unavailable and I can't place it. I can't find a mistake///// Cusom Block class: // CUSTOM BLOCK CLASS public class CustomSaplingBlock extends SaplingBlock { private final TreeSpawner tree; public CustomSaplingBlock(Properties properties, TreeSpawner spawner) { super(null, properties); this.tree = spawner; } @Override public void placeTree(ServerWorld world, BlockPos pos, BlockState state, Random rand) { if (state.get(STAGE) == 0) { world.setBlockState(pos, state.cycleValue(STAGE), 4); } else { tree.spawn(world, world.getChunkProvider().getChunkGenerator(), pos, state, rand); } } } public abstract class TreeSpawner { @Nullable protected abstract Feature<IFeatureConfig> getFeature(Random random); @Nullable protected abstract IFeatureConfig getConfig(Random random); public boolean spawn(ISeedReader reader, ChunkGenerator generator, BlockPos pos, BlockState blockunder, Random random) { Feature<IFeatureConfig> tree = getFeature(random); if (tree == null) return false; IFeatureConfig config = getConfig(random); if (config == null) return false; reader.setBlockState(pos, Blocks.AIR.getDefaultState(), 4); if (tree.generate(reader, generator, random, pos, config)) { return true; } reader.setBlockState(pos, blockunder, 4); return false; } } BLOCK INIT: public static final RegistryObject<Block> EXAMPLE_SAPLING = BLOCKS.register("example_sapling", () -> new CustomSaplingBlock(AbstractBlock.Properties.create(Material.LEAVES).sound(SoundType.PLANT) .hardnessAndResistance(0f).tickRandomly().notSolid(), null)); BLOCKSTATE (json): { "variants": { "": { "model": "examplemod:block/example_sapling" } } } BLOCK MODEL: { "parent": "block/cross", "textures": { "cross": "examplemod:block/example_sapling", "particle": "examplemod:block/example_sapling" } } Leaves and log are working perfectly. I think something is wrong with the model (?), but I think everything is right
  3. Yes, it's in the correct place, because the top layer is generated correctly. public class MiracleSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig> { public static final BlockState MIRACLE_GRASS = BlockInit.MIRACLE_GRASS.get().getDefaultState(); public static final SurfaceBuilderConfig MIRACLE_GRASS_CONFIG = new SurfaceBuilderConfig(MIRACLE_GRASS, MIRACLE_GRASS, MIRACLE_GRASS); public MiracleSurfaceBuilder(Codec<SurfaceBuilderConfig> codec) { super(codec); // TODO Auto-generated constructor stub } @Override public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) { SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, MIRACLE_GRASS_CONFIG); } } }
  4. Hi! I'm currently making my biome (i'm using json files). Everything is alright, but only top layer appears. Stone IS in the game, but just don't go to the biome. What should I do? { "config": { "top_material":{ "Name": "mymode:miracle_grass" }, "under_material":{ "Name": "mymode:miracle_stone" }, "underwater_material":{ "Name": "mymode:miracle_stone" } }, "type": "mymode:miracle" }
  5. Hi! Sorry, didin't understand how exactly I should randomize what color to use. If I have an enum in my entity class, how should I randlomly pick one?
  6. I'm working on an entity, which texture should have several variations. You know, there is blue sheep, black sheep, white sheep. I want to do the same thing. How should I do that? I'm working with Geckolib.
  7. THANK YOU SO MUCH I WOULD NEVER NOTICED IT MYSELF!!! 😭😭😭 Thank you that you invested so much time to help me! It works perfectly! I hope you'll have a nice day! Thank you so much!
  8. I was getting aan error, but now I've fixed it!!! My git repo: https://github.com/daekgorsel/ArmorPlusGit
  9. Sorry, I can't do that. My project is not loading to git repo. Can I just provide a screenshot or something?
  10. @SubscribeEvent public static void onLivingAttackEvent(LivingAttackEvent event) { LavaArmor.LOGGER.info("event is here"); . . . } Only this way! I've put Logger into this method and let a zombie hit me. Logger didn't show up.
  11. Sorry. I've deleted this stuff you mantioned: But it still doesn't work. I'm registering it only once in main class and I don't have @OnlyIn thingy. I can't even imagine why it doesn't work
  12. No, I'm not using them. My EventHandler and Main class sools exactly as I mentioned before. I've dropped gist to show other classes.
  13. I register it in the main class: @Mod(LavaArmor.MODID) public class LavaArmor { public static final String MODID = "lavaarmor"; public LavaArmor() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ItemInit.ITEMS.register(bus); MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(EventHandler.class); } @SuppressWarnings("deprecation") private void setup(final FMLCommonSetupEvent event) { } } Whole code: https://gist.github.com/daekgorsel/c903cff212bb5e8ecdad20bf2dd13c9a
  14. Yes, Logger is silent. @SubscribeEvent public static void onLivingAttackEvent(LivingAttackEvent event) { LavaArmor.LOGGER.info("event is here"); . . . } It doesn't appear. Why? I'm so confused because the exact same thing works in another project
  15. I'm not sure about you question, but when Entity attacks my, nothing appears on Console. So I think it's not called... am I right?
  16. Yes, I've already delete it, my EventHandler looks like this: public class EventHandler { @SubscribeEvent public static void onLivingAttackEvent(LivingAttackEvent event) { if (event.getEntityLiving().getItemStackFromSlot(EquipmentSlotType.HEAD).getItem() == ItemInit.LAVA_HELMET.get() && event.getEntityLiving().getItemStackFromSlot(EquipmentSlotType.CHEST).getItem() == ItemInit.LAVA_CHEST.get() && event.getEntityLiving().getItemStackFromSlot(EquipmentSlotType.LEGS).getItem() == ItemInit.LAVA_LEGGINGS.get() && event.getEntityLiving().getItemStackFromSlot(EquipmentSlotType.FEET).getItem() == ItemInit.LAVA_BOOTS.get()) { //event.getSource().getTrueSource().getEntity().onKillCommand(); if (event.getSource().getTrueSource().getEntity() instanceof MobEntity) { event.getSource().getTrueSource().getEntity().onKillCommand(); } } } }
  17. My goal is to kill every enemy that attack player that wears armor. But it just wasn't working for some reason. It's really strange, because I copied every single line from my previous project, where everything works fine. So game was loading, but entities just don't die. Whole code: https://gist.github.com/daekgorsel/c903cff212bb5e8ecdad20bf2dd13c9a
  18. Ye! I have been using this in my main class: MinecraftForge.EVENT_BUS.register(EventHandler.class); But it wasn't registering in the game.
  19. 😨 and what should I do..?
  20. Exception message: java.lang.IllegalArgumentException: Method public static void lavaarmor.EventHandler.onLivingAttackEvent(net.minecraftforge.event.entity.living.LivingAttackEvent) has @SubscribeEvent annotation, but takes an argument that is not a subtype of the base type interface net.minecraftforge.fml.event.lifecycle.IModBusEvent: class net.minecraftforge.event.entity.living.LivingAttackEvent
  21. I register it like in a tutorial you mentioned: public class MyStaticForgeEventHandler { @SubscribeEvent public static void arrowNocked(ArrowNockEvent event) { System.out.println("Arrow nocked!"); } } In the EventHandler And this in the main class: MinecraftForge.EVENT_BUS.register(MyStaticForgeEventHandler.class) When I delete this from the main class and add @Mod.EventBusSubscriber(modid = LavaArmor.MODID, bus = Bus.MOD, value = Dist.CLIENT) to the EventHandler class, my game doesn't work.
  22. I'm using Geckolib and I was strugglig while trying to make this work. My code: public class ExampleEntity extends CreatureEntity implements IAnimatable { private AnimationFactory factory = new AnimationFactory(this); public ExampleEntity(EntityType<? extends CreatureEntity> type, World worldIn) { super(type, worldIn); this.ignoreFrustumCheck = true; // TODO Auto-generated constructor stub } public static AttributeModifierMap.MutableAttribute setAttributes() { return CreatureEntity.func_233666_p_().createMutableAttribute(Attributes.MAX_HEALTH, 20.0f) .createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.2f); } @Override protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new SwimGoal(this)); this.goalSelector.addGoal(1, new PanicGoal(this, 3.45d)); this.goalSelector.addGoal(2, new LookRandomlyGoal(this)); this.goalSelector.addGoal(3, new LookAtGoal(this, PlayerEntity.class, 8.0f)); this.goalSelector.addGoal(4, new WaterAvoidingRandomWalkingGoal(this, 0.2d, 1000f)); } @Override protected int getExperiencePoints(PlayerEntity player) { // TODO Auto-generated method stub return 10; } @Override protected SoundEvent getDeathSound() { // TODO Auto-generated method stub return SoundEvents.ENTITY_HOGLIN_DEATH; } public boolean isPanic() { return this.goalSelector.getRunningGoals().anyMatch(goal -> goal.getGoal().getClass() == PanicGoal.class); } private <E extends IAnimatable> PlayState predicate(AnimationEvent<E> event) { if(isPanic()) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.example.panic", true)); return PlayState.CONTINUE; } if (this.prevPosX == this.getPosX() && this.prevPosY == this.getPosY() && this.prevPosZ == this.getPosZ()) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.example.nod", true)); return PlayState.CONTINUE; } else { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.example.walk", true)); return PlayState.CONTINUE; } } @Override public void registerControllers(AnimationData data) { data.addAnimationController(new AnimationController(this, "controller", 0, this::predicate)); } @Override public AnimationFactory getFactory() { return this.factory; } }
  23. Goal: when Entity attacks player, it dies. Code: public class EventHandler { @SubscribeEvent public static void onLivingAttackEvent(LivingAttackEvent event) { if (event.getEntityLiving().getItemStackFromSlot(EquipmentSlotType.HEAD).getItem() == ItemInit.LAVA_HELMET.get() && event.getEntityLiving().getItemStackFromSlot(EquipmentSlotType.CHEST).getItem() == ItemInit.LAVA_CHEST.get() && event.getEntityLiving().getItemStackFromSlot(EquipmentSlotType.LEGS).getItem() == ItemInit.LAVA_LEGGINGS.get() && event.getEntityLiving().getItemStackFromSlot(EquipmentSlotType.FEET).getItem() == ItemInit.LAVA_BOOTS.get()) { if (event.getSource().getTrueSource().getEntity() instanceof MobEntity) { event.getSource().getTrueSource().getEntity().onKillCommand(); } } } } And: @Mod(LavaArmor.MODID) public class LavaArmor { public static final String MODID = "lavaarmor"; public LavaArmor() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ItemInit.ITEMS.register(bus); MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(EventHandler.class); } @SuppressWarnings("deprecation") private void setup(final FMLCommonSetupEvent event) { } } I think I've done everything I've needed. Moreover, the exact same code works fine in my another project. What's wrong?
  24. I'M SO DUMB THANK YOU SO MUCH!!!!!!!!!!!
  25. [14:16:09] [Forge Version Check/INFO] [ne.mi.fm.VersionChecker/]: [forge] Found status: OUTDATED Current: 36.1.0 Target: 36.2.0 [14:16:21] [Worker-Main-12/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load lavaarmor:textures/armor/lava_boots.png : java.io.FileNotFoundException: lavaarmor:textures/armor/lava_boots.png [14:16:21] [Worker-Main-9/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load lavaarmor:textures/armor/lava_leggings.png : java.io.FileNotFoundException: lavaarmor:textures/armor/lava_leggings.png [14:16:21] [Worker-Main-9/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load lavaarmor:textures/item/jade_ingot.png : java.io.FileNotFoundException: lavaarmor:textures/item/jade_ingot.png [14:16:22] [Worker-Main-11/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load lavaarmor:textures/armor/lava_helmet.png : java.io.FileNotFoundException: lavaarmor:textures/armor/lava_helmet.png [14:16:22] [Worker-Main-9/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load lavaarmor:textures/armor/lava_chest.png : java.io.FileNotFoundException: lavaarmor:textures/armor/lava_chest.png I think this place, right?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.