Everything posted by vemerion
-
My entity that will be spawns in nether burn in fire
When you register your entity type, call the method immuneToFire().
-
Getting Error while Creating a new Explosion (Writing into PalettedContainer from multiple threads)
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.
-
[1.16.1] onArmorTick method not working
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.
-
[1.15] How do I use FourWayBlock?
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!
-
[1.15] How do I use FourWayBlock?
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.
-
[1.15] How do I use FourWayBlock?
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
-
[1.16.3] Custom Villager Point of Interest and professions not working
As far as I know, the Point of Interest system is broken, see this github issue for a workaround.
-
How To Detect An Entity colliding With A Block
onEntityCollision only fires if you are inside the blocks collision box. Try overriding getCollisionShape() and getShape() like CactusBlock does.
-
Make Projectile Not Have Gravity (1.6.3)
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.
-
Trying to create a magic mod
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.
-
[SOLVED] [1.15.2] Storing inventory contents to capability
No problem, glad to be of help!
-
[SOLVED] [1.15.2] Storing inventory contents to capability
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
-
Chest Item
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.
-
[1.15.2] Blocking Checking Radius? Effective or Better Way?
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?
-
Acces Transformer
Alright, then I suggest taking a look at the ObfuscationReflectionHelper class.
-
Acces Transformer
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);
-
setHealth(0) not killing
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.
-
setHealth(0) not killing
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
-
Acces Transformer
I don't think you need to use access transformers, why not access the CHANCES variable in ComposterBlock directly and add your own block?
-
[1.16.3 / 34.0.9] Missing Class?
I think CountRangeConfig no longer exists. You could look for a suitable replacement by looking at which classes implements IPlacementConfig. Perhaps TopSolidRangeConfig?
-
[1.15.2] world.getEntitiesWithinAABB locks world generation
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).
-
Is it possible to force the player to move naturally the way its facing?
You could use the player.move() method.
-
[SOLVED] [1.16.2] Unknown Problems With Creating Basic Entity
Try changing the BlueMagic() method like so: public BlueMagic() { EntityInit.ENTITY_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus()); }
-
[SOLVED] [1.16.2] Unknown Problems With Creating Basic Entity
Caused by: java.io.FileNotFoundException: mana-and-artifice:particles/sparkle.json This is your problem, you are missing a particle json file.
-
[1.15.2] ItemEntity not added to world
No problem, glad I could help!
IPS spam blocked by CleanTalk.