Jump to content

vemerion

Members
  • Posts

    390
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by vemerion

  1. When you register your entity type, call the method immuneToFire().
  2. You are approaching this the wrong way I am afraid. You cannot create an explosion on the client-side, and you cannot have mutable static variables like you have. If I were you, I would override the appropriate methods in your boom rod item class (such as onUse(), onItemUseFinish() etc) and create the explosion there. That way you can skip the event subscribers altogether.
  3. Just set the duration to something high (like Integer.MAX_VALUE) to approximate an infinite duration. To solve your other problem, just add an else to the if statement you already have, and use player.removePotionEffect(). You would still have to reapply the effect if it gets removed due to for example milk, as ChampionAsh pointed out.
  4. Well, by "hit collision" I mean the shape used for detecting if the player is interacting with the block, (e.g. left or right clicking it etc). Hope that clears it up!
  5. Yes, from what I can see, the makeShapes() method always starts from the bottom (e.g. y = 0). However you could just override makeShapes() and tweak it to your desire.
  6. This is what I have found after a bit of testing: * The first parameter decides the collision width of the middle pole * The second parameter decides the collision width of the extended parts * The third and fourth parameter does not affect the collision shape, but only the 'normal' shape (e.g. for hit collision) * The fifth parameter decides the collision height of the block
  7. As far as I know, the Point of Interest system is broken, see this github issue for a workaround.
  8. onEntityCollision only fires if you are inside the blocks collision box. Try overriding getCollisionShape() and getShape() like CactusBlock does.
  9. You are only setting no gravity in one constructor, which means that if you create the projectile with one of the other constructors, gravity will still be on.
  10. Just googling Electroblob's wizardry will get you to the github page. Do note however that the source code is for 1.12, so a few things about forge have changed since then.
  11. When you toss an item the itemstack is modified, and since you only pass a reference of the player itemstacks to your capability, those itemstacks will also shrink. Copy the stacks with .copy() in your detonate method when you save the itemstacks to create new identical itemstacks instead. However this also means that you can now duplicate items by saving, tossing items, and revert, since you will get your items back, and still have the old items on the ground. P.S. Interesting mod
  12. I am afraid you code is incomplete. There is a bunch of other stuff you need when creating a chest inventory, such as an IItemHandler to actually store the items, etc. TheGreyGhost's modding by example tutorial on this is quite good, which can be found here.
  13. Have you tried using the debugger to find out why the exception occurs? If it is line 57, the problem is almost certainly that containmentField is null. Perhaps it never get initialized to a value?
  14. Alright, then I suggest taking a look at the ObfuscationReflectionHelper class.
  15. You are making this way hard than it needs to be. This is all you need: CHANCES.put(YOUR ITEM HERE, THE FLOAT CHANCE HERE);
  16. You can create a custom DamageSource if you want a more appropriate death message. However, note that you should not use global variables like this, since they will be shared across all players. You should instead use capabilities.
  17. The kill command uses this to kill an entity: event.player.attackEntityFrom(DamageSource.OUT_OF_WORLD, Float.MAX_VALUE) However, there might be other problems with the code. You should not use global variables like this, for example what would happen if several players eat the item at the same time? You should use capabilities for these kinds of things
  18. I don't think you need to use access transformers, why not access the CHANCES variable in ComposterBlock directly and add your own block?
  19. I think CountRangeConfig no longer exists. You could look for a suitable replacement by looking at which classes implements IPlacementConfig. Perhaps TopSolidRangeConfig?
  20. I think the problem is that you can not use getEntitiesWithinAABB() while the world is created. If you remove the second getWorld() and use the IWorld instead it will not hang, but you will not find the nearby entities at world gen (but it will work fine after that).
  21. Try changing the BlueMagic() method like so: public BlueMagic() { EntityInit.ENTITY_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus()); }
  22. Caused by: java.io.FileNotFoundException: mana-and-artifice:particles/sparkle.json This is your problem, you are missing a particle json file.
×
×
  • Create New...

Important Information

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