Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. Cleavers don't have a right click function though...
  2. It is never set. public int currentValue; ConfigIntValues(String name, ConfigCategories category, int defaultValue, int min, int max, String desc) { this.name = name; this.category = category.name; this.defaultValue = defaultValue; this.min = min; this.max = max; this.desc = desc; }
  3. I would use the LivingAttackEvent to check if the entity attacking from the source is an instanceof EntityLiving and specifically EntityPlayer and then grab the inventory object to see if the item used was yours then apply the effect. got some problem on starting my mod, but i got the function writting with big hope that this test thing here will work: private void tryAbility(EntityLivingBase mob, EntityLivingBase target) { if ((target == null) || (target.getRidingEntity() != null) || (!mob.canEntityBeSeen(target))) { return; } long time = System.currentTimeMillis(); if ((time > this.nextAbilityUse) && (mob.getDistanceToEntity(target) > 3.0F) && (target.worldObj.canBlockSeeSky(new BlockPos(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ))))) { this.nextAbilityUse = (time + 15000L); mob.worldObj.addWeatherEffect(new EntityLightningBolt(mob.worldObj, target.posX, target.posY - 1.0D, target.posZ, false)); } } } What is the problem? What are you trying to accomplish? Post where the code is being called from.
  4. Put in a PR, I have thought of many uses for this myself, but have never actually needed it.
  5. That's not quite correct, or at least not clear enough. Since EntityPlayer extends EntityLivingBase, any instance of EntityPlayer is an instance of EntityLivingBase. The reverse is not true, not all instances of EntityLivingBase are an instance of EntityPlayer. This is why you cannot cast an EntityLivingBase to EntityPlayer, unless you first check that the EntityLivingBase is an instance of EntityPlayer. Yes, my wording on that was not quite right I will amend that right now.
  6. You could just use a List<ItemStack> and what was the purpose of func_190926_b?
  7. I don't know if its only me, but doing it that way seems to effect the timer and its success to not stick and result in a blank buff icon popping up in the top right of the screen. That's why I do it that way. I have not seen that "bug" myself, could you post a screenshot and the code you get from what I said?
  8. EntityLivingBase Is EntityLivingBase and EntityPlayer is EntityPlayer. But the effect will not effect the player when thrown, it will effect entities though. It will effect other players when thrown. The issue was when you threw it because entityplayer extends entitylivingbase it was applying the effect to the player when this was not what was needed. this was fixed by adding a timed delay. instanceof check is if that is the class or if it is an extension of the class ie EntityPlayer is an EntityLivingBase, but EntityLivingBase is not always an EntityPlayer. So by doing a check for EntityLivingBase you are also checking if it is a EntityPlayer. Then you go on to specifically check for EntityPlayer for no reason because it is included in the instanceof EntityLivingBase. Edit: and yes I understand what the original problem was your entity was spawning in the thrower and applying the effects to that player so adding a time delay defiantly worked.
  9. Eventually I will have stone bricks, mossy stone bricks, mossy chiseled stone bricks, chiseled stone bricks, ornate(or something) stone bricks, mossy ornate stone bricks...etc. Eventually it will be extremely complex and I'd like to keep my blockstate all one file. Additionally, I would like them all to count as BlockAncStoneBricks so I can use them in code equally (say if I require the player to place 5 stone bricks - every variant should count which is why I'm using meta). Its also a good learning experience. What he means is why don't you just assign the model to the block in the blockstate to "block/cube_all" and then apply the texture using the "textures" tag like so. "connected_down=true,connected_east=true,connected_north=true,connected_south=true,connected_up=true,connected_west=false":{ "model": "cube_all", "textures": { "west": "westFacingTexture" //just use "all": "texturepath" } } Don't mind the insane amount of variants (connected textures done with a forge blockstate json).
  10. A packet you are saying? or an event handler? Event handler and packets would be required. You subscribe to the InputEvent.KeyInputEvent and then send a packet to the server about the key being pressed. Then the server handles the execution.
  11. I don't think it ever did? And if it did it doesn't now (at least to my knowledge).
  12. I would use the LivingAttackEvent to check if the entity attacking from the source is an instanceof EntityLiving and specifically EntityPlayer and then grab the inventory object to see if the item used was yours then apply the effect.
  13. The way I am thinking this must be handled is intercepting the players movement key presses/holds. IE if spaces is down fly up? or If W is down move forward.
  14. You could point each metadata to a different model and add multiple layers by doing. { "parent": "item/generated" "textures": { "layer0": "texture1" "layer1": "texture2" #etc } }
  15. You can't do this. TileEntitySolarGenerator tileEntitySolarGenerator = new TileEntitySolarGenerator(); tileEntitySolarGenerator.neighborChanged(worldIn, pos) You need to do worldIn.getTileEntity(pos) to get the Tile Entity. And you would just use the super.getStateForPlacement(...)
  16. There is no event to mess with that slot, you could subscribe to the Right Click event and stop it there...
  17. You will want to create a new event like maybe CancelEntityUpdate or OverrideCanEntityUpdate. Or even suggest a change in name for the CanUpdateEvent.
  18. I do not think there is. The problem with this is that right click for the left hand is processed before right hand's right click. Plus there is no current loop in to that slot.
  19. I want to say this so loud VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING.
  20. world.getBlockState(new BlockPos(x, y, z)).getBlock() == block
  21. First don't implement ITileEntityProvider instead override hasTileEntity(IBlockState) and createTileEntity(World, IBlockState) Then you removed the methods neighborChanged()and getStateForPlacement()
  22. You only need the World and BlockPos ones,and what does your Block file look like now?
×
×
  • Create New...

Important Information

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