Jump to content

Discult

Members
  • Posts

    115
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Discult

  1. how do you think i should go about doing it then
  2. Right so i figured out a fix i simple made the method Sideonly Client and it works for now so all is good
  3. Its any player as soon as any player is a certain distance to the mob it changes the model all works fine in client but on server it does not i will try the World#playerEntities
  4. Hello i am wondering how i can check the distance from a mob to a player Server side i know how to do it client using something like entity.getDistance(Minecraft.getMinecraft().player) < 4F bit how would i do this server side Thank you.
  5. I have been trying to figure out how to call it from my model class(where the animations is set) i tried doing like entity.getAction or something but i cant find anything. Do you have anymore information that could help me.
  6. You know how the attack speed works?
  7. So i want to do a certain animation whenever my mob is attacking someone i am wanting to know what it is i need to call to check if the mob is attacking someone also how does the SharedMonsterAttrib attack speed work.
  8. Here i made one for you add this to the server folder and run it runServer.bat
  9. what may they be i essentially have the same ones as in entityZombie NVM found it thanks for your help
  10. correct place it in the same location as the forg jar and minecraft server jar
  11. right so i made a change and made the entity extend EntityMob it works now but the mob wont attack the play i added what is in zombie the attack nearest tareget task any clue how to make it work.
  12. just send the full block code in also the json files associated with it.
  13. make sure the forge version the client is using is the same as the one you are using for the server
  14. you are loading the server by clicking the minecraft_Server jar file correct? if so this is the wrong way to do a forge server you need to start the forge jar file to do this you need to open a text document and past this in it java -Xmx2G -Xms2G -jar forge-1.12.2-14.23.4.2738-universal.jar nogui once that is in you save the text document as something like run.bat make sure the file extension is .bat once that is saved double click the run.bat file and watch the magic happen.
  15. again you seem to only be loading default mc try the forge jar nor the default mc one
  16. From the log it looks like you are just loading the default minecraft_Server file there should be a forge jar file somewhere in the server in your .bat file change minecraft_server to the name of the forge jar file.
  17. Whenever i add the this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D); to my custom entity it causes the entity to not be able to be spawned, but the entity spawns and loads properly whenever i don't have the attribute if anyone can help me it would be greatly appreciated. EntityElementalGolem.java package com.saoteam.swordartonline.entitys.mobs; import com.saoteam.swordartonline.client.models.mobs.ModelElementalGolem; import com.saoteam.swordartonline.entitys.base.EntitySAOBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public class EntityElementalGolem extends EntitySAOBase { public EntityElementalGolem(World worldIn) { super(30, worldIn); this.setModel(new ModelElementalGolem()); } @Override protected void initEntityAI() { super.initEntityAI(); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); } @Override protected void applyEntityAttributes() { //82000 super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(35.0D); this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(12.0D); this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(1.0D); } } EntitySAOBase.java package com.saoteam.swordartonline.entitys.base; import com.saoteam.swordartonline.client.models.base.SAOModelBase; import com.saoteam.swordartonline.client.models.smd.ValveStudioModel; import com.saoteam.swordartonline.entitys.animation.AnimationVariables; import net.minecraft.client.model.ModelBase; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public abstract class EntitySAOBase extends EntityCreature { private int xpDropAmount; private DeltaListener deltas; private ModelBase model; private AnimationVariables animationVariables; private int animationFlyingDelayCounter = 0; public boolean animationCounting = false; public boolean animationSwap = false; private int animationDelayCounter = 0; private int flyingDelayCounter = 0; public EntitySAOBase(int xpDropAmount, World worldIn) { super(worldIn); this.xpDropAmount = xpDropAmount; } @SideOnly(Side.CLIENT) public ModelBase getModel() { return model; } //@SideOnly(Side.CLIENT) public void setModel(ModelBase modelIn) { model = modelIn; } /** * The AI all the mobs of sao should have will need to change some tiem soon when we add more mobs */ protected void initEntityAI() { this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIWanderAvoidWater(this, 0.2D)); this.tasks.addTask(2, new EntityAIWander(this, 0.2D)); this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(4, new EntityAILookIdle(this)); } protected void applyEntityAttributes() { super.applyEntityAttributes(); } public int getXpDropAmount(){ return xpDropAmount; } public AnimationVariables getAnimationVariables() { if (this.animationVariables == null) { this.animationVariables = new AnimationVariables(); } return this.animationVariables; } @Override public void onUpdate() { super.onUpdate(); final int animationFlyingDelayLimit = 10; final int animationDelayLimit = 3; final int flyingDelayLimit = 10; boolean animationFlyingCounting = false; boolean animationFlyingSwap = false; if (!this.onGround && !this.inWater) { if (this.flyingDelayCounter < flyingDelayLimit) { ++this.flyingDelayCounter; } } else { this.flyingDelayCounter = 0; } if(this.deltas != null) { this.deltas.update(); } if(world.isRemote) { if (this.animationVariables != null) { this.animationVariables.tick(); } if (animationFlyingCounting) { if (this.animationFlyingDelayCounter < animationFlyingDelayLimit) { this.animationFlyingDelayCounter += 1; animationFlyingSwap = false; } if (this.animationFlyingDelayCounter >= animationFlyingDelayLimit) { animationFlyingSwap = true; this.animationFlyingDelayCounter = 0; } } else { this.animationFlyingDelayCounter = 0; animationFlyingSwap = false; } if (this.animationCounting) { if (this.animationDelayCounter < animationDelayLimit) { this.animationDelayCounter += 1; this.animationSwap = false; } if (this.animationDelayCounter >= animationDelayLimit) { this.animationSwap = true; this.animationDelayCounter = 0; } } else { this.animationDelayCounter = 0; this.animationSwap = false; } if(getModel() instanceof SAOModelBase && this instanceof EntitySAOBase) { ((SAOModelBase)this.getModel()).doAnimation(this); } } } /** - @depricated / not being used. public DeltaListener getDeltaListener() { return this.deltas == null ? (this.deltas = new DeltaListener(this, new EnumEntityValue[0])) : this.deltas; } */ } Console Log: [13:59:35] [Server thread/ERROR] [FML]: Encountered an exception while constructing entity 'saomod:elementalgolem' java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_181] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_181] at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_181] at net.minecraftforge.fml.common.registry.EntityEntryBuilder$ConstructorFactory.apply(EntityEntryBuilder.java:304) [EntityEntryBuilder$ConstructorFactory.class:?] at net.minecraftforge.fml.common.registry.EntityEntryBuilder$ConstructorFactory.apply(EntityEntryBuilder.java:1) [EntityEntryBuilder$ConstructorFactory.class:?] at net.minecraftforge.fml.common.registry.EntityEntry.newInstance(EntityEntry.java:68) [EntityEntry.class:?] at net.minecraft.entity.EntityList.createEntityByIDFromName(EntityList.java:204) [EntityList.class:?] at net.minecraft.entity.EntityList.createEntityFromNBT(EntityList.java:211) [EntityList.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.createEntityFromNBT(AnvilChunkLoader.java:601) [AnvilChunkLoader.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.readWorldEntityPos(AnvilChunkLoader.java:560) [AnvilChunkLoader.class:?] at net.minecraft.command.server.CommandSummon.execute(CommandSummon.java:97) [CommandSummon.class:?] at net.minecraft.command.CommandHandler.tryExecute(CommandHandler.java:119) [CommandHandler.class:?] at net.minecraft.command.CommandHandler.executeCommand(CommandHandler.java:91) [CommandHandler.class:?] at net.minecraft.network.NetHandlerPlayServer.handleSlashCommand(NetHandlerPlayServer.java:960) [NetHandlerPlayServer.class:?] at net.minecraft.network.NetHandlerPlayServer.processChatMessage(NetHandlerPlayServer.java:939) [NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketChatMessage.processPacket(CPacketChatMessage.java:38) [CPacketChatMessage.class:?] at net.minecraft.network.play.client.CPacketChatMessage.processPacket(CPacketChatMessage.java:1) [CPacketChatMessage.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) [PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_181] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_181] at net.minecraft.util.Util.runTask(Util.java:50) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:723) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:185) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_181] Caused by: java.lang.NullPointerException at com.saoteam.swordartonline.entitys.mobs.EntityElementalGolem.applyEntityAttributes(EntityElementalGolem.java:35) ~[EntityElementalGolem.class:?] at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:165) ~[EntityLivingBase.class:?] at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:90) ~[EntityLiving.class:?] at net.minecraft.entity.EntityCreature.<init>(EntityCreature.java:21) ~[EntityCreature.class:?] at com.saoteam.swordartonline.entitys.base.EntitySAOBase.<init>(EntitySAOBase.java:34) ~[EntitySAOBase.class:?] at com.saoteam.swordartonline.entitys.mobs.EntityElementalGolem.<init>(EntityElementalGolem.java:16) ~[EntityElementalGolem.class:?] ... 27 more [13:59:35] [Server thread/WARN] [minecraft/EntityList]: Skipping Entity with id saomod:elementalgolem [13:59:35] [main/INFO] [minecraft/GuiNewChat]: [CHAT] Unable to summon object [13:59:37] [Server thread/INFO] [minecraft/NetHandlerPlayServer]: Player72 lost connection: Disconnected [13:59:37] [Server thread/INFO] [minecraft/MinecraftServer]: Player72 left the game [13:59:37] [Server thread/INFO] [minecraft/NetHandlerPlayServer]: Stopping singleplayer server as player logged out [13:59:38] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server [13:59:38] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players [13:59:38] [Server thread/INFO] [minecraft/MinecraftServer]: Saving worlds [13:59:38] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'New World'/overworld [13:59:38] [Server thread/INFO] [FML]: Unloading dimension 0 [13:59:38] [Server thread/INFO] [FML]: Applying holder lookups [13:59:38] [Server thread/INFO] [FML]: Holder lookups applied [13:59:39] [main/INFO] [minecraft/Minecraft]: Stopping! [13:59:39] [main/INFO] [minecraft/SoundManager]: SoundSystem shutting down... [13:59:39] [main/WARN] [minecraft/SoundManager]: Author: Paul Lamb, www.paulscode.com Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
  18. the entity is a simple mob entity but for the mod i am making it is a boss that needs a really high health since the weapon that we are giving for the event does 700 damage That is why i am asking wondering if there is a way to override it.
  19. The max health of an entity.
  20. there is a custom json that is stored in the versions folder but it isn't a typical json it changed the main class to launchwrapper and all complicated things install forge using the install then look at the json and you will see what i mean.
  21. Hello i am wondering if LWJGL is not on the server cause i am trying to use the Matrix4f function and it is not working on server saying the class is not found??
  22. That was the problem but not at the same time haha but it instantly made me figure out what was wrong. The problem was I have a initAnim method and i was calling that in a private static void loadModel() removing to just the entity constructor fixed the problem. Thank you for your help.
  23. Hello so here is my problem when i have one version of my entity in the world it works fine but as soon as a second one is in it doesn't do the anims proper. there is usually two different things that happen and they are. 1. when the first entity does e.g. walk anims the second entity (that is standing still) also does the walk animation. 2. When either of the entitys move it flicks between what both entitys are e.g. one is walking and one is idle both mobs anims quickly switch between them. Any information on the matter would be brilliant. Thank you, Discult
  24. Fixed my problem all is good i had i removed the super.doRender and when i added it back it fixed my problem
  25. I mean the blue line when Ctrl-B is hit when it moves the model moves but for my model it doesn't so i am wondering if i am missing the code for it so i am asking what is the string to make it rotate.
×
×
  • Create New...

Important Information

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