Jump to content

vemerion

Members
  • Posts

    389
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by vemerion

  1. In the class ModEventBusEvents you are registering a recipe type using a vanilla registry! You should instead use the Forge registry, ForgeRegistries.RECIPE_TYPES, similar to how you register block and items. Also, looks like you missed an 's' in 'foodstuffs' in the smoked_steak.json file
  2. Try adding a call to '.noOcclusion()' on the BlockBehaviour.Properties when you create the block.
  3. You should use the Forge registry when registering features. You can read more about how to do it here.
  4. Looks like your modid is "mymod", but you specified it as "warmod_perekur" in the sounds file!
  5. You also have to take item enchantability into account: https://minecraft.fandom.com/wiki/Enchanting_mechanics#Enchantability
  6. You need to synch the inventory of the blockEntity to the client! You can do it either with a custom packet, or by overriding relevant methods in your block entity (getUpdatePacket/onDataPacket/getUpdateTag/handleUpdateTag).
  7. You could do it like this: player.setItemInHand(InteractionHand.MAIN_HAND, ItemStack.EMPTY);
  8. You should use Attributes.ATTACK_DAMAGE and not EntityAttributes.GENERIC_ATTACK_DAMAGE ๐Ÿ™‚
  9. No problem, glad you were able to figure it out!
  10. Aha, so you are using some kind of plugin for Minecraft modding for IntelliJ? Either way, en_us is the default localization file, so maybe the path is wrong somehow after all?
  11. Perhaps you accidentally registered the event twice?
  12. You would need to listen to the LivingDeathEvent and check if the player is holding your custom totem and if so prevent the death. You need to manually play the sound TOTEM_USE and create the particle TOTEM_OF_UNDYING when you prevent the death.
  13. Looks like you specified the y position of the head as -22.0F. Try changing it to -8, that should put the pivot at the bottom of the head.
  14. You can use EntityEquipmentInvWrapper to get an item handler wrapping handItems and armorItems, which you can then use to create the slots in a ContainerMenu.
  15. You need to put the modid of your mod and not the literal text "modid". Or did you just sanitize the modid before putting it here because you don't want to reveal your modid? ๐Ÿคญ Another thing that could be the problem, you might need to refresh the project in your IDE if you externally modified the lang file. I know this is true for Eclipse at least, not sure about IntelliJ.
  16. Regardless of if you are using geckolib or not, I would think the easiest way to do this is with a custom RenderLayer added to your entity renderer (you can check vanilla code for examples) and then specify LightTexture.FULL_BRIGHT as the packed light parameter when you render the eyes to get them to glow.
  17. To make this work I think you only need to override the push method. That way the entity will still push away other entities, but itself remain still. Although you might still have to override the knockback method so it does not move when it is attacked. I think the Shulker is a good example to look at in this case ๐Ÿ™‚
  18. You can register a sound event as usual, and then use AbstractTickableSoundInstance to play the sound once the boss spawns. That way you can stop the sound when the boss is defeated. Here is how Botania does it for their boss music ๐Ÿ™‚
  19. If you want to check for a certain item and delete all stacks of it from the player inventory, you could do something like this: IItemHandler inventory = new PlayerMainInvWrapper(player.inventory); for (int i = 0; i < inventory.getSlots(); i++) if (inventory.getStackInSlot(i).getItem() == <THE ITEM YOU WANT TO DELETE>) inventory.extractItem(i, inventory.getSlotLimit(i), false); The IItemHandler is a class provided by Forge that makes manipulation of inventories easier, which is why it is advantageous to use that instead of manipulating the player inventory directly. EDIT: Or do you want to consume the item you are using? The you could do stack.shrink(1) or similar on the item stack in question.
  20. I think a good starting point would be to look at how the WitherEntity and the GhastEntity fires these projectiles, and do it in a similar fashion ๐Ÿ™‚
  21. One idea would be to subscribe to the PlayerTickEvent and check that the player is in water but close to the surface, something like this: @SubscribeEvent public static void jump(PlayerTickEvent event) { PlayerEntity player = event.player; if (<CHECK IF PLAYER IS JUMPING> && player.isInWater() && player.level.getBlockState(new BlockPos(player.getX(), player.getY() + 0.5, player.getZ())) .getFluidState().isEmpty()) { player.setDeltaMovement(player.getDeltaMovement().add(0, 0.2, 0)); } } Unfortunately, the field LivingEntity.jumping is protected so you can not easily access it to check if the player is jumping. Probably best to use reflection to access it.
  22. The drinking animation is completely hardcoded in vanilla, if you want a custom drinking animation for one of your items you have to subscribe to the RenderHandEvent and make your own animation.
  23. I don't think this is currently possible without using something like mixins. Might be worth it to add an event for it though.
  24. If you want to change the hitbox size of the entity, you can change the arguments to the sized() method when creating the entity type. If you want to scale the model of the entity, you could use the scale() method on the matrix stack in the entity renderer (although I have never used GeckoLib so I don't know if that changes anything in regards to the rendering).
×
×
  • Create New...

Important Information

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