Everything posted by Animefan8888
-
[1.10.2] Stop player from using the left hand slot
Cleavers don't have a right click function though...
-
TE throws a Null Exception during update.
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; }
-
TE throws a Null Exception during update.
You never set currentValue so it is 0.
-
[1.10.2]Problem with Entity Hitting with Sword
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.
-
[1.10.2] Stop player from using the left hand slot
Put in a PR, I have thought of many uses for this myself, but have never actually needed it.
-
Potion Effects Applying Oddly (Entitythrowable.) 1.11 (solved)
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.
-
NonNullList for 1.10?
You could just use a List<ItemStack> and what was the purpose of func_190926_b?
-
Potion Effects Applying Oddly (Entitythrowable.) 1.11 (solved)
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?
-
Potion Effects Applying Oddly (Entitythrowable.) 1.11 (solved)
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.
-
[1.10.2]Understanding Block States
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).
-
[1.10.2] Steering Entity
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.
-
[1.10.2] Stop player from using the left hand slot
I don't think it ever did? And if it did it doesn't now (at least to my knowledge).
-
[1.10.2]Problem with Entity Hitting with Sword
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.
-
[1.10.2] Steering Entity
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.
-
Add a layer of texture to item depending on meta
You could point each metadata to a different model and add multiple layers by doing. { "parent": "item/generated" "textures": { "layer0": "texture1" "layer1": "texture2" #etc } }
-
[1.10.2] Looking for an adjacent block.
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(...)
-
How to testfor and set blocks relative to a block
That is brilliant! Why didn't I think of this?...
-
[1.10.2] Stop player from using the left hand slot
There is no event to mess with that slot, you could subscribe to the Right Click event and stop it there...
-
[1.10.2] Stop player from using the left hand slot
- PR Minecraft Forge Github Quick Question
You will want to create a new event like maybe CancelEntityUpdate or OverrideCanEntityUpdate. Or even suggest a change in name for the CanUpdateEvent.- [1.10.2] Stop player from using the left hand slot
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.- How to testfor and set blocks relative to a block
I want to say this so loud VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING.- How to testfor and set blocks relative to a block
world.getBlockState(new BlockPos(x, y, z)).getBlock() == block- [1.10.2] Looking for an adjacent block.
First don't implement ITileEntityProvider instead override hasTileEntity(IBlockState) and createTileEntity(World, IBlockState) Then you removed the methods neighborChanged()and getStateForPlacement()- [1.10.2] Looking for an adjacent block.
You only need the World and BlockPos ones,and what does your Block file look like now? - PR Minecraft Forge Github Quick Question
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.