Jump to content

FelixTFD

Members
  • Posts

    5
  • Joined

  • Last visited

FelixTFD's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I took a look at the RespawnAnchorBlock code, but it's full of functions like: func_235566_a_() It's really hard to find out what is happening exactly.
  2. Hi! I have a problem with the BlockEvent#EntityPlaceEvent. Not a problem with the event or how to subscribe to it, that works perfectly fine. So I check the block the player places if that block is a specific block then it goes to second if statement (I know I could use one but this way it is more clear what is happening in the code. Gonna use one if statement later) the second if statement should check if that block has enough charges or not. Now in my mod there is only one block that has a "public int charge" in it's class. I have no idea how to check for that value. I was thinking about something like getInstanceAtLocationOfSpecificBlock() but there is no such function. Any ideas how to manage this?
  3. The problem solved with this code: stack.damageItem(1, attacker, (p_220045_0_) -> { p_220045_0_.sendBreakAnimation(EquipmentSlotType.MAINHAND); });
  4. I don't have the "vies call hierarchy" option in IntelliJ. I tried to use every single entity i have access to, but none of them worked. It says the following when I put "target" and "attacker" in the function: Which is strange because when I hover my mouse over the function this pops up: It clearly says "LivingEntity" I got confused
  5. Hi! I'm new to modding and the mod I'm creating has a weapon which attacks specific entities with more damage. I overrided the hitEntity() function from SwordItem and the damage stuff works fine, but the sword's durability does not go down. I found this damageItem() function, but whatever I pass into this it does not work. Here is the unfinished code: @Override public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker){ if(target instanceof ZombieEntity || target instanceof SkeletonEntity || target instanceof HuskEntity || target instanceof StrayEntity){ target.attackEntityFrom(DamageSource.GENERIC, getAttackDamage() + 5); }else{ target.attackEntityFrom(DamageSource.GENERIC, getAttackDamage() + 1); } damageItem(stack, 1, ) return true; }
×
×
  • Create New...

Important Information

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