Everything posted by urabaros
-
Cross block is strange
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.
-
SaplingBlock don't work
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
-
Custom biome generation (where is my stone)
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); } } }
-
Custom biome generation (where is my stone)
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" }
-
Variations of entity's texure (like differently colored flowers)
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?
-
Variations of entity's texure (like differently colored flowers)
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.
-
Event Handler doesn't work
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!
-
Event Handler doesn't work
I was getting aan error, but now I've fixed it!!! My git repo: https://github.com/daekgorsel/ArmorPlusGit
-
Event Handler doesn't work
Sorry, I can't do that. My project is not loading to git repo. Can I just provide a screenshot or something?
-
Event Handler doesn't work
@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.
-
Event Handler doesn't work
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
-
Event Handler doesn't work
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.
-
Event Handler doesn't work
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
-
Event Handler doesn't work
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
-
Event Handler doesn't work
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?
-
Event Handler doesn't work
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(); } } } }
-
Event Handler doesn't work
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
-
Event Handler doesn't work
Ye! I have been using this in my main class: MinecraftForge.EVENT_BUS.register(EventHandler.class); But it wasn't registering in the game.
-
Event Handler doesn't work
😨 and what should I do..?
-
Event Handler doesn't work
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
-
Event Handler doesn't work
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.
-
How to set an animation for a panicing entity?
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; } }
-
Event Handler doesn't work
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?
-
Item textures doesn't load.
I'M SO DUMB THANK YOU SO MUCH!!!!!!!!!!!
-
Item textures doesn't load.
[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?
IPS spam blocked by CleanTalk.