MarkusBordihn / BOs-Easy-NPC

Create easily NPC for your world or for your mod.
Other
16 stars 6 forks source link

[Doc] Using the /summon command with easy_npc #124

Open mcmdarcs2 opened 4 months ago

mcmdarcs2 commented 4 months ago

Hi Easy NPC devs, i wanna to ask you. Is there any way to create put the modified entity into minecraft summon command. Ex: /summon easy_npc:templar

Minecraft_ 1 18 2 - Singleplayer 3_29_2024 5_34_33 PM

MarkusBordihn commented 4 months ago

You can look at a NPC and press F3+i to get all of their current data with a /summon command like: ´´´ /summon easy_npc:orc -15.50 70.00 9.50 {Brain: {memories: {}}, ModelData: {Position: {}, Pose: "DEFAULT", Visible: {}, Rotation: {}, DefaultPose: "STANDING"}, HurtByTimestamp: 0, Owner: [I; 940439953, -167562164, -1601161573, -1389718966], ForgeData: {}, Attributes: [{Base: 0.699999988079071d, Name: "minecraft:generic.movement_speed"}, {Base: 32.0d, Modifiers: [{Amount: -0.03237451325730065d, Operation: 1, UUID: [I; -357824034, 515588271, -1106256546, 1653757810], Name: "Random spawn bonus"}], Name: "minecraft:generic.follow_range"}], Invulnerable: 1b, FallFlying: 0b, ActionData: {ActionEventSet: {}, ActionPermissionLevel: 0}, EasyNPCVersion: 1, PortalCooldown: 0, AbsorptionAmount: 0.0f, DialogData: {DialogDataSet: [], Type: "NONE"}, FallDistance: 0.0f, CanUpdate: 1b, DeathTime: 0s, Aggressive: 0b, HandDropChances: [0.085f, 0.085f], PersistenceRequired: 0b, AngerTime: 0, Motion: [0.0d, 0.0d, 0.0d], Navigation: {Home: {X: -16, Y: 70, Z: 9}}, EntityAttribute: {CanFloat: 0b, IsPushable: 0b, CanBeLeashed: 0b, Freefall: 0b, PushEntities: 0b, CanCloseDoor: 0b, CanPassDoor: 0b, CanUseNetherPortal: 0b, CanOpenDoor: 0b, IsAttackable: 0b, LightLevel: 7}, Health: 20.0f, LeftHanded: 0b, Air: 300s, OnGround: 1b, Offers: {TradingType: "BASIC", BasicMaxUses: 64, BasicRewardedXP: 1, Recipes: {Recipes: [{maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:stone", Count: 1b}, sell: {id: "minecraft:grass_block", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:stone", Count: 3b}, sell: {id: "minecraft:grass_block", Count: 3b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:stone", Count: 2b}, sell: {id: "minecraft:grass_block", Count: 2b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:air", Count: 1b}, sell: {id: "minecraft:air", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:air", Count: 1b}, sell: {id: "minecraft:air", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:air", Count: 1b}, sell: {id: "minecraft:air", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:air", Count: 1b}, sell: {id: "minecraft:air", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:air", Count: 1b}, sell: {id: "minecraft:air", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:air", Count: 1b}, sell: {id: "minecraft:air", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:air", Count: 1b}, sell: {id: "minecraft:air", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:air", Count: 1b}, sell: {id: "minecraft:air", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}, {maxUses: 64, buyB: {id: "minecraft:air", Count: 1b}, buy: {id: "minecraft:air", Count: 1b}, sell: {id: "minecraft:air", Count: 1b}, xp: 1, uses: 0, priceMultiplier: 1.0f, specialPrice: 0, demand: 0, rewardExp: 1b}]}, ResetsEveryMin: 0, Inventory: {}}, ScaleY: 1.0f, Rotation: [85.81406f, 7.0945764f], ScaleX: 1.0f, HandItems: [{}, {}], SkinData: {SkinURL: "", SkinType: "DEFAULT", Skin: ""}, Variant: "DEFAULT", ArmorDropChances: [0.085f, 0.085f, 0.085f, 0.085f], Profession: "NONE", ScaleZ: 1.0f, ObjectiveData: {ObjectiveDataSet: [{Type: "LOOK_AT_PLAYER", Prio: 9}, {Type: "LOOK_AT_MOB", Prio: 10}, {Type: "LOOK_AT_RESET", Prio: 9}], HasObjectives: 1b}, Fire: -1s, ArmorItems: [{}, {}, {}, {}], CanPickUpLoot: 0b, HurtTime: 0s} ´´´

However the command is too long to paste it directly into the game so you need to use .mcfunctions or something like this to be able to use it. You can also shorten the data, because some of them are not needed for all NPCs like the trading data.

Alternative you can try the NPC Spawner see: https://github.com/MarkusBordihn/BOs-Easy-NPC/wiki/Spawner

mcmdarcs2 commented 4 months ago

ok, do you know how to customize mob loot? If possible with script

MarkusBordihn commented 4 months ago

Mob loot, is not implemented yet, see: https://github.com/MarkusBordihn/BOs-Easy-NPC/issues/111

You could work around this by using the On Dead action, see: https://github.com/MarkusBordihn/BOs-Easy-NPC/wiki/Actions#basic-actions-

mcmdarcs2 commented 4 months ago

OHHH alright. TYSM

mcmdarcs2 commented 4 months ago

wait I ask you once more. in Epic Fight combining with Easy NPC how to make npc mob shoot using modded ranged weapon? And change weapon attack speed and damage too

MarkusBordihn commented 3 months ago

Depends on the modded range weapon. If this is just an normal item with a lot of Mixins, then it is not support like "MrCrayfish's Gun Mod".

If it's a real range weapon which is based on the crossbow or bow, it should work out of the box. Could you please share an example what modded range weapon you are referring to.

mcmdarcs2 commented 3 months ago

image Minecraft_ 1 18 2 - Singleplayer 3_30_2024 10_26_22 AM

These types of ranged weapon basically base on normal bow , crossbow and throwable items. NPCs should perform ranged attack once they wield those type of weapons

MarkusBordihn commented 3 months ago

By default the NPC are not attacking, you need to define the corresponding objectives see: https://github.com/MarkusBordihn/BOs-Easy-NPC/wiki/Objectives#attack-objectives-%EF%B8%8F

If modded weapons are not working with any of these options, please open a new issue report with the details about the mod and I'm happy to take a closer look.

mcmdarcs2 commented 3 months ago

By default the NPC are not attacking, you need to define the corresponding objectives see: https://github.com/MarkusBordihn/BOs-Easy-NPC/wiki/Objectives#attack-objectives-%EF%B8%8F

If modded weapons are not working with any of these options, please open a new issue report with the details about the mod and I'm happy to take a closer look.

ok now i'll find out soon cuz this mod combined with epic fight. It's somewhat delayed with other modded weapons. So is there any way to make npc attack each others? Cuz i try to enable attack mobs but they didn't attack