Jump to content

clearcut

Members
  • Posts

    19
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

clearcut's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. while(startingHealth - victim.getHealth() < flatDamageCap && (victim.getHealth() / maxHealth) > damagePercentageCap) { if((victim.ticksExisted - startingTime) % 10 == 0 ) { //do damage } } This is more or less how I wanted it to work. It would keep checking it the total damage dealth by the method reaches the flat damage cap or percentage damage cap and would only deal damage on the 10th tick
  2. I have made an event that deals damage to a living entity. How would I make it deal the damage every 10 ticks or half a second or until another condition is met?
  3. Ah, I didn't know about the overwriting. stand.writeAdditional(compound); compound.putBoolean("ShowArms", true); Adding the lines above before the readAdditional method seems to work but does it fix the overwriting issue? I wanted to find a work around using setShowArms since I did not know how to use it.
  4. Thanks, it now works For anyone else trying to do this, the final code is: package com.chaoticsoul.evolate.events; import com.chaoticsoul.evolate.Evolate; import net.minecraft.entity.item.ArmorStandEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; @Mod.EventBusSubscriber(modid = Evolate.MOD_ID, bus = Bus.FORGE) public class SpawnArmorStandEvent { @SubscribeEvent public static void spawnArmorStandEvent(EntityJoinWorldEvent event) { if (event.getEntity() instanceof ArmorStandEntity) { ArmorStandEntity stand = (ArmorStandEntity) event.getEntity(); CompoundNBT compound = new CompoundNBT(); compound.putBoolean("ShowArms", true); stand.readAdditional(compound); } } }
  5. I am trying to make an event that will spawn armor stands with arms whenever an armor stand is spawned but I cannot get it to work. I included a logger to see if it gets past the if statement that checks if the entity spawned was an armor stand and it does not log anything so I am assuming that is the problem(I put one outside of the if statement and it does log when things spawn). Any ideas? package com.chaoticsoul.evolate.events; import com.chaoticsoul.evolate.Evolate; import net.minecraft.entity.item.ArmorStandEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; @Mod.EventBusSubscriber(modid = Evolate.MOD_ID, bus = Bus.FORGE) public class SpawnArmorStandEvent { @SubscribeEvent public static void spawnArmorStandEvent(LivingSpawnEvent event) { if (event.getEntityLiving() instanceof ArmorStandEntity) { Evolate.LOGGER.info("test"); ArmorStandEntity stand = (ArmorStandEntity) event.getEntityLiving(); CompoundNBT compound = new CompoundNBT(); compound.putBoolean("ShowArms", true); stand.writeAdditional(compound); } } } Also, I am new to nbt data so that part may be wrong as well.
  6. It is finally fixed! Thanks for the help For the people having the same issue as me. super(modelSize, 0, 128, 128); ^I implemented this change and followed this tutorial below to update all my classes. That made the model look a bit better as it fixed the double rendering issue. However, I still had the same issue. I then found out that the problem was as below. ModelRenderer LeftBoot = new ModelRenderer(this, 0, 13); LeftBoot.setTextureOffset(22, 53).addBox(-3.0F, 8.0F, -3.0F, 1.0F, 4.0F, 6.0F, 0.0F, 0.0F, 0.0F); This makes the group "LeftBoot" as well as all my other groups that were declared have a texture offset(that is the "0,13"). In tabula, to find the texture offset for a box, it adds the texture offset from the group to the texture offset from the individual boxes and so your model will look normal. However, in game it does not work the same way. LeftBoot = new ModelRenderer(this); LeftBoot.setTextureOffset(22, 66).addBox(-3.0F, 8.0F, -3.0F, 1.0F, 4.0F, 6.0F, 0.0F, 0.0F, 0.0F); To fix this, I changed the declaration of all my groups to be declared as above. This makes the group texture offset (0,0) then you can add the numbers that were in the group's texture offset to each of the boxes in that group.
  7. My textures have been changed to make sure that nothing is in the 64 x 32 area so I believe that shouldnt get in the way of the default model rendering. But I still do not understand why the textures on the model are so off. I thought this might be the same problem for me but I do not have any decimals and I tried playing around with scaling the texture up aswell as increasing textureHeight and textureWidth in the model but It does not make it any better. Thanks for your help so far btw,
  8. http://prntscr.com/teaidw ^how to textures look in tabula(im using the latest version btw 8.0.1 for 1.15) ModelRenderer helmetLocal = this.Helmet; ModelRenderer chestplateLocal = this.Chestplate; ModelRenderer leftSleeveLocal = this.LeftSleeve; ModelRenderer rightSleeveLocal = this.RightSleeve; ModelRenderer rightLeggingLocal = this.RightLegging; ModelRenderer leftLeggingLocal = this.LeftLegging; ModelRenderer rightBootLocal = this.RightBoot; ModelRenderer leftBootLocal = this.LeftBoot; ^ also i'm not sure if this is what you meant with the local variables and would the double rendering cause the incorrect textures
  9. Just to make sure, does it animate correctly? If it does, then the way I fixed the problem you are having was by going in to tabula(what I used instead of blockbench) and opening up the player model. Then, make all of your parts childs of the player model. e.g. make helmet a child of the head. Once it is like that you should re align all of your parts so they are in the right place before removing them as children (even if it looks wrong) and deleting the player model from it and then exporting the model and doing the rest again.
  10. I was having the same problem and I believe it was fixed by changing the render method in the model class. https://pastebin.com/FbbM7Sy5 https://pastebin.com/arPBtjHS Here are my classes for reference
  11. I created a custom armor model for an armor set in my mod using tabula. I made a texture map and the textures were showing correctly on tabula but in game they do not show as intended, why is this? My classes: https://pastebin.com/FbbM7Sy5 https://pastebin.com/arPBtjHS Example of the problem: http://prntscr.com/tdck17
  12. I think I am having the same problem with textures but I do not understand how to do this, could you elaborate please?
  13. I am now having other problems regarding this item. the item shows up in game like in the screenshots. I don't know where the item model (for when it is in hand) is stored so that I can change it and use it for my item. I assumed it would be in the json files but I have tried to copy and change it to my item with no difference. Also, after I hold right click to throw the "trident" the entity model does not render but it still collides with entities/ blocks and makes noise. These are all the files related to the item. (I know I shouldn't be copying big blocks of code but I am trying to understand how things work before I make my own things from scratch.): https://github.com/clearcut01/evolate
  14. FIXED: the problem was with my initialization
×
×
  • Create New...

Important Information

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