-
Posts
1160 -
Joined
-
Days Won
7
Everything posted by poopoodice
-
Getting the IFactory of an entity for registry
poopoodice replied to FerroCentric's topic in Modder Support
You have to have a constructor that takes EntityType<?> and World as argument. -
[1.16.5] Get World instance from Event Instance
poopoodice replied to MLGDuckboi's topic in Modder Support
https://sites.google.com/site/simplestjava/java-object-casting -
[1.16.5] Get World instance from Event Instance
poopoodice replied to MLGDuckboi's topic in Modder Support
All worlds implements IWorld, so you can cast it. -
Check Commands#handleCommand
-
[1.16] Obtaining Potion Effects From Arrow Entity
poopoodice replied to OberonPuck's topic in Modder Support
You might need to use reflection for this. -
[1.16.4] How do I prevent items from being placed in certain slots?
poopoodice replied to LK1905's topic in Modder Support
Maybe just drop the item before shrinking it? -
Show your model as well.
-
Call trackIntArray and pass the IIntArray in the constructor of your container.
-
[1.16.5] NullPointerException when Spawning in Entity
poopoodice replied to Pickle_Face5's topic in Modder Support
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. -
Stun effect, cancel entity from moving
poopoodice replied to LuccaPossamai's topic in Modder Support
You can replace their AI tasks with your own one. -
[1.16] BlockStateProvider is registered, but not called
poopoodice replied to SerpentDagger's topic in Modder Support
Have you rerun task genXXXRuns? -
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); } }
-
Is the event being triggered? What's in your reload listener?
-
There's an AddReloadListenerEvent
-
Event "setSecondsOnFire" won't connect to SwordItem
poopoodice replied to Skullblade's topic in Modder Support
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. -
Event "setSecondsOnFire" won't connect to SwordItem
poopoodice replied to Skullblade's topic in Modder Support
All parts that are related to the item. -
Event "setSecondsOnFire" won't connect to SwordItem
poopoodice replied to Skullblade's topic in Modder Support
Post your code. -
Event "setSecondsOnFire" won't connect to SwordItem
poopoodice replied to Skullblade's topic in Modder Support
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. -
Event "setSecondsOnFire" won't connect to SwordItem
poopoodice replied to Skullblade's topic in Modder Support
Override hitEntity() in your item class and set target on fire there. -
You need to call LivingEntity#setActiveHand() in use() for the player to start "using".
-
Event "setSecondsOnFire" won't connect to SwordItem
poopoodice replied to Skullblade's topic in Modder Support
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. -
Create an instance of the entity (iirc there's a method in EntityType called create() or something), and then add it through world.addEntity.
-
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.