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

poopoodice

Members
  • Content Count

    977
  • Joined

  • Days Won

    7

Everything posted by poopoodice

  1. Call trackIntArray and pass the IIntArray in the constructor of your container.
  2. You have to assign your entity attributes, there's a EntityAttributeCreationEvent or something named similar in the latest version. In older versions you can register them in GlobalEntityTypeAttributes through common setup event.
  3. You can replace their AI tasks with your own one.
  4. List<EntityType<?>> MONSTERS = new ArrayList<>(); void summonRandomMonster() { if (MONSTERS.isEmpty()) MONSTERS.addAll(ForgeRegistries.ENTITIES.getValues().filter((type) -> is type classification monster)) Entity entity = (random EntityType from MONSTERS).create(world); if (entity != null) { entity.setPosition(x, y, z); world.addEntity(entity); } }
  5. Is the event being triggered? What's in your reload listener?
  6. There's an AddReloadListenerEvent
  7. I'm pretty sure the particle can be defined in the blockmodel.json.
  8. Well.. I have no idea why it doesn't work, and I don't see any problems except you should set a max damage (durability) in your item properties, and your entity2 is in fact the attacker. Entity1 is the target.
  9. Why do you have your "on-hit effect" code located in the lambda? It will only be triggered upon item break. Also the easiest way to do it is just set the target on fire and then return super, two lines of code.
  10. Override hitEntity() in your item class and set target on fire there.
  11. You need to call LivingEntity#setActiveHand() in use() for the player to start "using".
  12. In the Item class, (Item#hitEntity seems to be better than IForgeItem#onLeftClickEntity) @Override is just an annotation that is not necessary, but highly recommended to make sure you are actually overriding the method. DamageSource is a class that contains the information of the attack, such as the type of the attack (fire? explosion? where blast protection checks for this), the attacker, and even the direct attacker like arrows (IndirectDamageSource). Therefore the DamageSource will never match to a single item, where you can only obtain the information of the weapon from the attac
  13. Create an instance of the entity (iirc there's a method in EntityType called create() or something), and then add it through world.addEntity.
  14. If I understand this correctly, that indicates the "key" of the sound, and then the game will search in sounds.json for further information such as volume, file location...etc. So as long as the directory https://github.com/BananaSquares/Forge-Mod/blob/master/src/main/resources/assets/mcore/sounds.json#L5 is correct and sound file is under assets/modid/sounds it should work.
  15. Unfortunately no, you can't ever compare a DamageSource to an Item. In fact instead of using an event, if it's your own item you can just override onLeftClickEntity (or named something similar, where is called on the item after AttackEntityEvent) and set the target on fire there.
  16. https://github.com/BananaSquares/Forge-Mod/blob/master/src/main/java/mod/trianglesinpoo/mcores/ModSounds.java#L12 new SoundEvent(new ResourceLocation(Main.MODID, "music_disk/equilibrium.ogg") Just change it to something like: new SoundEvent(new ResourceLocation(Main.MODID, "equilibrium_disk") or just simply "equilibrium" as long as it is same as https://github.com/BananaSquares/Forge-Mod/blob/master/src/main/resources/assets/mcore/sounds.json#L2 You should really make the names more consistent.
  17. Please provide a repo.
  18. I don't think ItemInit.EMBERCLEAVE is a type of DamageSource. You should be checking if the item of the attacker is holding is the sword (DamageSource#getTrueSource gives you the entity). However this can be abused in multiple ways, such as swap to the sword as soon as the shot arrow hits the target, or even a thrown splash poison potion will be able to burn the target to death. Try AttackEntityEvent instead.
  19. I think you should be able to get all entitytypes from ForgeRegistries.ENTITIES, and then cache them by filtering out the ones with EntityClassification.MONSTER.
  20. Or just call ItemStack#setDamage since ItemStack#damageItem is more likely to be used on other purposes.
  21. This does not really make sense as you are damaging the carrot jam stack, and then replace it with a bucket in the crafting table.
×
×
  • Create New...

Important Information

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