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

urabaros

Members
  • Posts

    53
  • Joined

  • Last visited

Everything posted by urabaros

  1. 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!
  2. I was getting aan error, but now I've fixed it!!! My git repo: https://github.com/daekgorsel/ArmorPlusGit
  3. Sorry, I can't do that. My project is not loading to git repo. Can I just provide a screenshot or something?
  4. @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.
  5. 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
  6. 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.
  7. 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
  8. 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
  9. 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?
  10. 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(); } } } }
  11. 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
  12. Ye! I have been using this in my main class: MinecraftForge.EVENT_BUS.register(EventHandler.class); But it wasn't registering in the game.
  13. 😨 and what should I do..?
  14. 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
  15. 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.
  16. 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; } }
  17. 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?
  18. I'M SO DUMB THANK YOU SO MUCH!!!!!!!!!!!
  19. [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?
  20. I'm SURE that did everything right, but it just doesn't load. I'm trying to create a custom armor and I already did it before. I simply can't comprehend where is the problem, textures from Armor's Item just don't show up (but the armor texture itself while wearing works fine). public static final RegistryObject<Item> LAVA_BOOTS = ITEMS.register("lava_boots", () -> new ArmorItem(LavaMaterial.LAVA_ARMOR, EquipmentSlotType.FEET, new Item.Properties().group(ItemGroup.COMBAT))); Json: { "parent": "item/generated", "textures": { "layer0": "lavaarmor:armor/lava_boots" } } Everyting looks completely fine for me! I don't what happened! My path: My 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) { DeferredWorkQueue.runLater(() -> { }); } }
  21. The first thing was fized by uploading mappings, I was using official insted of snapshot. Yea, Items., but when I write something like this it don't work and I don't remember what should I import. NONE_ARMOR("lava", 9900, new int[] {4, 5, 6, 4}, 17, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 99f, 12.5f, () -> Ingredient.fromItems(Items.LAVA_BUCKET));
  22. Hi! I don't know why, but when I write this line: NONE_ARMOR("none", 9900, new int[] {4, 5, 6, 7}, 17, SoundEvents.LAVA_AMBIENT, 99f, 12.5f, () -> Ingredient.fromItems(ItemInit.NONE_INGOT.get())); my code break apart. I don't know why, actually, I've coppied it from my another project where it works right. ANd also!!! How should I set a vanilla item as a repair material? I can't figure it out My entire class: public class LavaMaterial implements IArmorMaterial { NONE_ARMOR("none", 9900, new int[] {4, 5, 6, 7}, 17, SoundEvents.LAVA_AMBIENT, 99f, 12.5f, () -> Ingredient.fromItems(ItemInit.NONE_INGOT.get())); private static final int[] baseDurability = { 128, 144, 169, 112}; private final String name; private final int durabilityMultiplier; private final int[] armorVal; //boots leggings chest helmet private final int enchantability; private final SoundEvent equipSound; private final float toughness; private final float knockbackResistence; private final Ingredient repairIngredient; LavaMaterial(String name, int durabilityMultiplier, int[] armorVal, int enchantability, SoundEvent equipSound, float toughness, float knockbackResistence, Supplier<Ingredient> repairIngredient) { this.name = name; this.durabilityMultiplier =durabilityMultiplier; this.armorVal = armorVal; this.enchantability = enchantability; this.equipSound = equipSound; this.toughness = toughness; this.knockbackResistence = knockbackResistence; this.repairIngredient = repairIngredient.get(); } @Override public int getDurabilityForSlot(EquipmentSlotType slotIn) { // TODO Auto-generated method stub return this.baseDurability[slotIn.getIndex()] * this.durabilityMultiplier; } @Override public int getDefenseForSlot(EquipmentSlotType slotIn) { // TODO Auto-generated method stub return this.armorVal[slotIn.getIndex()]; } @Override public int getEnchantmentValue() { // TODO Auto-generated method stub return this.enchantability; } @Override public SoundEvent getEquipSound() { // TODO Auto-generated method stub return this.equipSound; } @Override public Ingredient getRepairIngredient() { // TODO Auto-generated method stub return this.repairIngredient; } @Override public String getName() { // TODO Auto-generated method stub return this.name; } @Override public float getToughness() { // TODO Auto-generated method stub return this.toughness; } @Override public float getKnockbackResistance() { // TODO Auto-generated method stub return this.knockbackResistence; } }
  23. Hm... public boolean isPanic() { //LOGGER.info("The AttackingEntity will be: " + this.getAttackingEntity()); 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.akirathedemon.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.akirathedemon.nod", true)); return PlayState.CONTINUE; } else { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.akirathedemon.walk", true)); return PlayState.CONTINUE; } It looks completely right for me. Is there something that can prevent it from working?
×
×
  • Create New...

Important Information

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