
jaxbymc42
Members-
Content Count
14 -
Joined
-
Last visited
Community Reputation
0 NeutralAbout jaxbymc42
-
Rank
Tree Puncher
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
How exactly do I go about using LivingEquipmentChangeEvent?
-
public class HoneyArmorItem extends ArmorItem { public HoneyArmorItem(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builder) { super(materialIn, slot, builder); } @Override public void onArmorTick(ItemStack stack, World world, PlayerEntity player) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.HONEY_BOOTS.get() && player.inventory.armorItemInSlot(1).getItem() == ItemInit.HONEY_LEGGINGS.get() && player.inventory.armorItemInSlot(2).getItem() == ItemInit.HONEY_CHESTPLATE.get() && player.inventory.armorItemInSlot(3).getItem() == ItemInit.HONEY_HELMET.get()) { player.getAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(new AttributeModifier("MaxHealth", 4.0f, AttributeModifier.Operation.ADDITION)); } else { super.onArmorTick(stack, world, player); player.getAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(new AttributeModifier("MaxHealth", 4.0f, AttributeModifier.Operation.ADDITION)); } } }
-
I tried applying modifiers straight out but then I ran into the issue of infinitely adding 2 more hearts.
-
I have made a set of armor that, when the full set is worn, the player is granted with 2 additional hearts. Whenever you take the armor off, the two extra hearts disappear but are still "there" and the player acts as though he has 12 hearts when only 10 are shown (until the player takes enough damage to lose those 2 extra hearts then it is like vanilla MC with 10 hearts). I was just wondering what else to do to check and remove the extra life so when the armor is off, the player has only 10 hearts (not the extra 2 hearts that are "there" till damage gets rid of them). public class HoneyArmorItem extends ArmorItem { public HoneyArmorItem(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builder) { super(materialIn, slot, builder); } @Override public void onArmorTick(ItemStack stack, World world, PlayerEntity player) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.HONEY_BOOTS.get() && player.inventory.armorItemInSlot(1).getItem() == ItemInit.HONEY_LEGGINGS.get() && player.inventory.armorItemInSlot(2).getItem() == ItemInit.HONEY_CHESTPLATE.get() && player.inventory.armorItemInSlot(3).getItem() == ItemInit.HONEY_HELMET.get()) { player.getAttributes().getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(24); } else { super.onArmorTick(stack, world, player); player.getAttributes().getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20); } } }
-
[1.15.2] Edible Experience Item Trouble [Solved]
jaxbymc42 replied to jaxbymc42's topic in Modder Support
Okay. I realized I made up a method and also did not check if a player is in creative mode or not to shrink the item stack. -
Hello! I am currently trying to add an item that, upon right click, gives the player some experience by spawning some xp orbs on the players location. I thought this was correct but clearly it isn't. When right clicked, the edible experience item does not do anything. Pastebin for edible experience class: https://pastebin.com/5u1vCrx6 Thank you for your time.
-
[1.15.2] Deferred Registry Blocks Not Loading - Forge 31.2.0
jaxbymc42 replied to jaxbymc42's topic in Modder Support
I thought that the lines below did that in my main class: @SubscribeEvent public static void onRegisterItems(final RegistryEvent.Register<Item> event) { final IForgeRegistry<Item> registry = event.getRegistry(); BlockInit.BLOCKS.getEntries().stream().map(RegistryObject::get).forEach(block -> { final Item.Properties properties = new Item.Properties().group(ChrispyModItemGroup.instance); final BlockItem blockItem = new BlockItem(block, properties); blockItem.setRegistryName(block.getRegistryName()); registry.register(blockItem); }); LOGGER.debug("Registered BlockItems!"); } -
Since moving everything to deferred registries, my mod's blocks are not in the game. The ore gen generates the ores underground and the blocks appear with textures and all but there is no possible way of obtaining the blocks (not in creative menu, /give doesn't work, middle clicking the ore doesn't work). The blocks can't even be crafted. The only leading bit of information I have is the log says this for every one of my mod's blocks when loading a world: "[Server thread/ERROR] [minecraft/LootTableManager]: Couldn't parse loot table chrispymod:blocks/cyan_redstone_lamp com.google.gson.JsonSyntaxException: Expected name to be an item, was unknown string 'chrispymod:cyan_redstone_lamp'" There are also parsing errors when loading recipes. My loot tables have not been moved and I did not encounter this issue before switching to deferred registries. I have attached ChrispyMod.java (Main), BlockInit.java, and my latest.log. If something will not load or you need more info, let me know. I am genuinely stuck and have no idea what is wrong. Any help is appreciated. Thank you for your time. ChrispyMod.java BlockInit.java latest.log
-
This is resolved
-
I took your advice and now the item is working... kind of. The only issue now is that it won't shoot in the y-range (up or down). It only shoots straight out no matter how high or low I look. Basically, I used the code from GhastEntity like you had mentioned and targetted the PlayerEntity instead of the livingentity variable but with negative values so the fireball shot away from the player. https://pastebin.com/Q9RwgBNf
-
Okay, so I have changed a bunch of code and now the fireball shoots but only in one general direction (it varies a little bit on the direction every time I throw it). The fireballs fly into the +X and +Z plane. I don't understand raytracing very well as I haven't worked with it much up until this point. https://pastebin.com/Xt9M3Rkd
-
I apologize for my stupidity
-
I want this item to shoot a fireball in the direction I am looking whenever I right click with the item, removing one durability on each use. Currently, right clicking does absolutely nothing. (Is this enough info? (I'm sorry!))
-
I have a custom wand that I would like to summon a fireball entity and shoot it like a Ghast on right click using ActionResultType onItemUse and then remove one durability from the item. I have created a class and put together what I thought would work for this situation but I am currently lost on it. Any help is appreciated and I feel bad for asking anything. Thank you! Here is the item class: https://pastebin.com/0h9XLTYi