Everything posted by vemerion
-
[1.19] Custom armor model
First you need to create the model, for example with Blockbench, and then you need to export it as a java file. Then you need to implement IClientItemExtensions.getHumanoidArmorModel() to return your custom model, and Item.initializeClient() to provide you custom IClientItemExtensions.
-
[SOLVED] Item: [modid]:[itemname] does not exist
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
-
[Solved] [1.19.2] How to make non-full block
Glad you were able to get it working!
-
[Solved] [1.19.2] How to make non-full block
Try adding a call to '.noOcclusion()' on the BlockBehaviour.Properties when you create the block.
-
[1.18.2] Error trying to register a custom feature based on KelpFeature [SOLVED]
You should use the Forge registry when registering features. You can read more about how to do it here.
-
[1.19] Registering Sounds
Looks like your modid is "mymod", but you specified it as "warmod_perekur" in the sounds file!
-
[1.19.2] How to set properly getMinCost and getMaxCost on Enchantment
You also have to take item enchantability into account: https://minecraft.fandom.com/wiki/Enchanting_mechanics#Enchantability
-
(1.18.2) Block entity renderer disappears after leaving the world
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).
-
How i remove an item in mainHand?
You could do it like this: player.setItemInHand(InteractionHand.MAIN_HAND, ItemStack.EMPTY);
-
[1.18] im trying to find the listed damage attribute of a sword.
You should use Attributes.ATTACK_DAMAGE and not EntityAttributes.GENERIC_ATTACK_DAMAGE ๐
-
PlayerLoggedIn Event is Firing Twice for Each Player
No problem, glad you were able to figure it out!
-
What's the problem with the localization file?
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?
-
PlayerLoggedIn Event is Firing Twice for Each Player
Perhaps you accidentally registered the event twice?
-
problems when i create a custom Totem of Undying.
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.
-
Theres no pivot point at entity head
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.
-
[1.18.2] GUI for custom entity with inventory
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.
-
What's the problem with the localization file?
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.
-
[1.18.2] Glowing texture elements for mob
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.
-
(1.18.2) make my entity un-pushable
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 ๐
-
[1.19.2] Boss Music
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 ๐
-
Detecting Item in player inventory and delete it in OnItemUseFirst.
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.
-
[Solved] Minecraft Projectile Launching with Custom Tools (version 1.16)
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 ๐
-
(SOLVED) [1.17.1] Water Jumping Event
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.
-
Set animations offset from drinkable item
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.
-
How do you use isPiglinCurrency()
I don't think this is currently possible without using something like mixins. Might be worth it to add an event for it though.
IPS spam blocked by CleanTalk.