Jump to content

RetroBuzz

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

RetroBuzz's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I want to be able to change things like Attack damage and attack speed as a way to upgrade these weapons. However I am pretty stuck on how to do that. My latest attempt has been with ItemAttributes and this not good helper class. public void replaceModifiers(EquipmentSlotGroup pSlot, Holder<Attribute> attributeType, AttributeModifier attributeModifier, double amount) { AttributeModifier modifier = new AttributeModifier(attributeModifier.id(), attributeModifier.amount() + amount, attributeModifier.operation()); ItemAttributeModifiers.builder() .add(attributeType, modifier, pSlot) .build(); }
  2. This is what I have now, nothing shows on the screen and after using mana the game freezes. public class ManaOverlay extends Overlay { ResourceLocation manaBar = ResourceLocation.fromNamespaceAndPath(RSGArmoury.MOD_ID, "/textures/block/spawnable_arena_wall.png"); @Override public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) { Mana mana = new Mana(); pGuiGraphics.blit(manaBar, 16, -16, 0, 0, mana.getMana(), 16, mana.getMana(), 16); } @Override public boolean isPauseScreen() { return false; } }
  3. Ok, I see so a screen is only really useful for like a menu but would that explain the crashing? I haven't attempted making an overlay yet. By the way is there a way to get a notification from this site? I only check in every once in a while when I remember to see if there was an update. As I sent that it gave me a push notification pop up lol.
  4. Ok, sounds like I would probably be best with a overlay then. I have also tried to make an event that setScreens when a magic item is pulled out and I think it actually crashed the game.
  5. This is my latest attempt : public class ManaScreen extends Screen { Mana mana = new Mana(); boolean removeManaBar = false; ResourceLocation manaBar = ResourceLocation.fromNamespaceAndPath(RSGArmoury.MOD_ID, "/textures/block/spawnable_arena_wall.png"); public ManaScreen() { super(Component.literal("Mana")); } @Override protected void init() { super.init(); Minecraft.getInstance().setScreen(this); } @Override public boolean isPauseScreen() { return false; } @Override public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) { pGuiGraphics.blit(manaBar, 10, -10, 0, 0, mana.getMana(), 10, mana.getMana(), 10); if (removeManaBar) { this.onClose(); return; } super.render(pGuiGraphics, pMouseX, pMouseY, pPartialTick); } public void addManaBar() { removeManaBar = false; Minecraft.getInstance().setScreen(new ManaScreen()); } public boolean removeManaBar() { return removeManaBar = true; } }
  6. I tried a few different things that all didnt work. Right now I have nothing but what I had that seemed most likely to work was just a guiOverlay.blit(x, y, z, vx, vy, getMana()). I dont remember the exact code but it was somthing along those lines. It was in a new class extending screen I believe.
  7. I can't seem to get anything to render on the screen. I have the mana working but can't make a bar or even just the int display. I am not good with rendering anything.
  8. So I am trying to make essentially a necromancer sorta thing and I can't seem to get the LivingChangeTargetEvent to work, I don't know much about events so I'm not sure if I am doing something wrong with the BusSubscriber or something? With this code and other various debug codes it never did or changed anything. @Mod.EventBusSubscriber(modid = RSGArmoury.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class RSGEvents { @SubscribeEvent public void undeadArmyIgnore(LivingChangeTargetEvent event) { if (event.getEntity() instanceof Player player) { event.setNewTarget(null); } } using this debug does nothing. @SubscribeEvent public void undeadArmyIgnore(LivingChangeTargetEvent event) { event.getNewTarget().sendSystemMessage(Component.literal("New Target Debug")); event.getOriginalTarget().sendSystemMessage(Component.literal("Original Target Debug")); event.getEntity().sendSystemMessage(Component.literal("Entity Debug")); if (event.getNewTarget() instanceof Player player) { event.setNewTarget(null); } }
×
×
  • Create New...

Important Information

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