Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FelixTFD

Members
  • Joined

  • Last visited

  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; }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.