Jump to content

poopoodice

Members
  • Posts

    1160
  • Joined

  • Days Won

    7

Everything posted by poopoodice

  1. You have to have a constructor that takes EntityType<?> and World as argument.
  2. https://sites.google.com/site/simplestjava/java-object-casting
  3. All worlds implements IWorld, so you can cast it.
  4. Check Commands#handleCommand
  5. You might need to use reflection for this.
  6. Maybe just drop the item before shrinking it?
  7. Personally I use IForgeRegistryEntry#getRegistryName and then ResourceLocation#getNameSpace to get the id of the object.
  8. Show your model as well.
  9. Call trackIntArray and pass the IIntArray in the constructor of your container.
  10. 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.
  11. You can replace their AI tasks with your own one.
  12. Have you rerun task genXXXRuns?
  13. 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); } }
  14. Is the event being triggered? What's in your reload listener?
  15. There's an AddReloadListenerEvent
  16. I'm pretty sure the particle can be defined in the blockmodel.json.
  17. 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.
  18. All parts that are related to the item.
  19. 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.
  20. Override hitEntity() in your item class and set target on fire there.
  21. You need to call LivingEntity#setActiveHand() in use() for the player to start "using".
  22. 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 attacker stored.
  23. Create an instance of the entity (iirc there's a method in EntityType called create() or something), and then add it through world.addEntity.
  24. 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.
×
×
  • Create New...

Important Information

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