• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I want to summon a vanilla-minecraft wolf with an owner set already. I have stored the player's UUID in an nbt tag (on an itemstack), but when I use the setOwnerID() method, the dog wont get a collar, nor can I sit it down. But what is interesting is that it still walks towards me, and telepors if I go away... I tried using updateEntity() method (both on ServerWorld and ClientWorld). If I reopen my world, the dog has a collar, and I can make it sit. I'm kinda new, so this might be terribly obvious. Thanks in advance! My code for summoning the entity: Minecraft instance= Minecraft.getInstance(); ServerWorld sWorld=Minecraft.getInstance().getIntegratedServer().getWorld(instance.player.getEntityWorld().getDimension().getType()); WolfEntity Entity=EntityType.WOLF.create(sWorld); entity.moveToBlockPosAndAngles(instance.player.getPosition(),0,0); entity.onInitialSpawn(sWorld, sWorld.getDifficultyForLocation(instance.player.getPosition()), SpawnReason.EVENT, eData, (CompoundNBT)null); entity.setOwnerId(itemStackWithNBT.getStack().getTag().getUniqueId("owner")); sWorld.addEntity(entity); sWorld.updateEntity(entity); instance.world.updateEntity(entity); //Sorry for messy code I also tried debugging using the isOwner() method, it said false.
    • I don't think I should have to create a custom crafting block when the anvil fulfills exactly what I need and the restriction is purely a technical one. You can already rename Items in it without a center item present, so it's not like the anvil is hardcoded to never do anything at all without a center item.
    • I’m pretty sure that the anvil is supposed to work that way (with a center item, since the anvil combines the two). If you want a crafting method that turns one item into another at the cost of experience, you should make a custom crafting block instead.
    • Line 149 in RepairContainer.java (in 1.15.2, I don't know about 1.16) checks whether the middle slot in the anvil GUI is empty, and only if it isn't the onAnvilChange ForgeHook is called, which makes is making it pretty impossible for me to implement anvil recipes that don't need an item in the center. I've had to resort to making a coremod to implement this, but I don't think it should be that way.   The relevant lines look like this: if (!itemstack2.isEmpty()) { if (!ForgeHooks.onAnvilChange(this, itemstack, itemstack2, this.outputSlot, this.repairedItemName, j)) { return; } I don't think much of anything would break if the ForgeHook was to be moved in front of the first line to allow events to be sent with empty center slots.   If you're wondering why I would want to do what I'm doing, it's a flavor thing for the mod I'm working on and also lets me make it cost XP to get the output item, to keep it out of the early game.
    • This guy on youtube has a great series to follow along with if you learn visually. I did already know Java prior and you will need to know it as well, but the series was great to get familiar with modding in minecraft in particular! Turtywurty on youtube
  • Topics

  • Who's Online (See full list)