function rangedLaunched(event) {
event.npc.despawn()
}
Hmm Maybe I am not using the scrips right, I added that to a npc that uses only ranged attacks, made sure to enable scrips in the settings tab but it is not despawning after attacking.
Hmm Maybe I am not using the scrips right, I added that to a npc that uses only ranged attacks, made sure to enable scrips in the settings tab but it is not despawning after attacking.
In the scripting GUI what does it say next to Language?
Thank's @daottoad for helping me earlier!. Forget the two player idea, that will take me too much work, instead, my map will just have a little extra stuff given just in case someone is playing with a friend.
Now I have another question if you have the time to answer it, if not its no problem.
My question is: Is is possible to script an NPC to change factions?
I have one NPC depending on what side you choose in my map Evil, Good or Indifferent, becomes an ally to you or not.
I have toiled over the scripting day and night, to the point I have decided I will just have the NPC's do small event's for most things until i understand scripting a bit more and use command blocks for many things as well. You guys are awesome for knowing all this stuff, but I can't handle work and then come home to try to learn all this at once.
You guys are the heroes here! Thank you for helping not just myself, but everyone who posts here!
Keep being Awesome! And Thank you Noppes for this MOD!
Thank you for taking the time to read my post. And for helping me tenfold!
Rollback Post to RevisionRollBack
I'm a bird flying higher than the sun. I am not the same or different.
I am using 1.10.2. Pretty much any command I try in a command block doesn't work. For example, I type "/noppes npc SomeNPCName create" in chat it works fine. I do the same in a command block and I get an error (Screenshot).
I'm trying the 1.11.2 beta. I had the following crash when messing with the day/night NPC settings. I set the the time to night time and then the server crashed. Error below:
---- Minecraft Crash Report ----
WARNING: coremods are present:
CreativePatchingLoader (CreativeCore v1.7.0 mc1.11.2.jar)
LoadingPlugin (ChunkAnimator-MC1.11-1.2.jar)
LittlePatchingLoader (LittleTiles v1.4.6 mc1.11.2.jar)
MalisisCorePlugin (malisiscore-1.11.2-5.1.1.jar)
Contact their authors BEFORE contacting forge
// I feel sad now
Time: 4/2/17 10:08 PM
Description: Ticking entity
java.lang.NullPointerException: Ticking entity
at noppes.npcs.roles.JobFarmer.writeToNBT(JobFarmer.java:68)
at noppes.npcs.controllers.data.DataTransform.getJob(DataTransform.java:84)
at noppes.npcs.controllers.data.DataTransform.transform(DataTransform.java:207)
at noppes.npcs.ai.EntityAITransform.func_75249_e(EntityAITransform.java:29)
at net.minecraft.entity.ai.EntityAITasks.func_75774_a(SourceFile:102)
at net.minecraft.entity.EntityLiving.func_70626_be(EntityLiving.java:769)
at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:2255)
at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:573)
at noppes.npcs.entity.EntityNPCInterface.func_70636_d(EntityNPCInterface.java:388)
at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2085)
at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:296)
at noppes.npcs.entity.EntityNPCInterface.func_70071_h_(EntityNPCInterface.java:273)
at noppes.npcs.entity.EntityCustomNpc.func_70071_h_(EntityCustomNpc.java:35)
at net.minecraft.world.World.func_72866_a(World.java:1961)
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:840)
at net.minecraft.world.World.func_72870_g(World.java:1931)
at net.minecraft.world.World.func_72939_s(World.java:1747)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:621)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:720)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:384)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Server thread
Stacktrace:
at noppes.npcs.roles.JobFarmer.writeToNBT(JobFarmer.java:68)
at noppes.npcs.controllers.data.DataTransform.getJob(DataTransform.java:84)
at noppes.npcs.controllers.data.DataTransform.transform(DataTransform.java:207)
at noppes.npcs.ai.EntityAITransform.func_75249_e(EntityAITransform.java:29)
at net.minecraft.entity.ai.EntityAITasks.func_75774_a(SourceFile:102)
at net.minecraft.entity.EntityLiving.func_70626_be(EntityLiving.java:769)
at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:2255)
at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:573)
at noppes.npcs.entity.EntityNPCInterface.func_70636_d(EntityNPCInterface.java:388)
at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2085)
at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:296)
at noppes.npcs.entity.EntityNPCInterface.func_70071_h_(EntityNPCInterface.java:273)
at noppes.npcs.entity.EntityCustomNpc.func_70071_h_(EntityCustomNpc.java:35)
at net.minecraft.world.World.func_72866_a(World.java:1961)
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:840)
at net.minecraft.world.World.func_72870_g(World.java:1931)
-- Entity being ticked --
Details:
Entity Type: customnpcs:customnpc (noppes.npcs.entity.EntityCustomNpc)
Entity ID: 1015
Entity Name: Ethan
Entity's Exact location: 1906.50, 66.00, -476.27
Entity's Block location: World: (1906,66,-477), Chunk: (at 2,4,3 in 119,-30; contains blocks 1904,0,-480 to 1919,255,-465), Region: (3,-1; contains chunks 96,-32 to 127,-1, blocks 1536,0,-512 to 2047,255,-1)
Entity's Momentum: 0.00, -0.08, 0.00
Entity's Passengers: []
Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
at net.minecraft.world.World.func_72939_s(World.java:1747)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:621)
-- Affected level --
Details:
Level name: NewWorld
All players: 1 total; [EntityPlayerMP['vin0m'/80, l='NewWorld', x=1902.63, y=65.00, z=-469.51]]
Chunk stats: ServerChunkCache: 1138 Drop: 0
Level seed: 5995804518695279578
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options:
Level spawn location: World: (2394,25,-326), Chunk: (at 10,1,10 in 149,-21; contains blocks 2384,0,-336 to 2399,255,-321), Region: (4,-1; contains chunks 128,-32 to 159,-1, blocks 2048,0,-512 to 2559,255,-1)
Level time: 50192073 game time, 20000 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 1 (now: false), thunder time: 1 (now: false)
Level game mode: Game mode: adventure (ID 2). Hardcore: false. Cheats: false
Stacktrace:
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:720)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:384)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
at java.lang.Thread.run(Unknown Source)
I am using 1.10.2. Pretty much any command I try in a command block doesn't work. For example, I type "/noppes npc SomeNPCName create" in chat it works fine. I do the same in a command block and I get an error (Screenshot).
yes it was working in earlier versions - I think noppes know about it but you can remind him at https://discord.gg/cBASshA
I am using custom npcs, and I am trying to make my NPC's have voice acting. Two questions
1. is it possible for me to use multiple folders to organise my sounds? I don't want my voice acting to be in the same place my music is, it will get jumbled and practically inaccessible.
and 2. I can see the file, I can select the file, but it will not play. I played it with and without streaming and it does not make any sound. It is in .OGG format. and by all accounts should be able to play, what am I doing wrong? This is the 1.10.2 version of the mod and I am using a sound pack someone else made as a guideline to how im supposed to code it, along with several tutorials.
I am using custom npcs, and I am trying to make my NPC's have voice acting. Two questions
1. is it possible for me to use multiple folders to organise my sounds? I don't want my voice acting to be in the same place my music is, it will get jumbled and practically inaccessible.
and 2. I can see the file, I can select the file, but it will not play. I played it with and without streaming and it does not make any sound. It is in .OGG format. and by all accounts should be able to play, what am I doing wrong? This is the 1.10.2 version of the mod and I am using a sound pack someone else made as a guideline to how im supposed to code it, along with several tutorials.
its probably your sound sounds.json - going to have to see it to find the mistake - there can be 0 errors in a sounds.json
actually I don't think I ever got sounds to work in the customnpcs folder I put them in a resource pack under minecraft
Would anyone mind helping me to update a few scripts to the new format for 1.10? I'm having a lot of trouble with the new API and it's the only thing keeping me from updating 1.7.
- This first script went under the killed tab to make a held item seem to disappear on death
“I know there's a proverb which that says 'To err is human,' but a human error is nothing to what a computer can do if it tries.”
― Agatha Christie, Hallowe'en Party
Would anyone mind helping me to update a few scripts to the new format for 1.10? I'm having a lot of trouble with the new API and it's the only thing keeping me from updating 1.7.
- This first script went under the killed tab to make a held item seem to disappear on death
The first script works great, but the trader one is still throwing errors.
Rollback Post to RevisionRollBack
“I know there's a proverb which that says 'To err is human,' but a human error is nothing to what a computer can do if it tries.”
― Agatha Christie, Hallowe'en Party
daottoad is good at scripting.
Thank you very much!
Hmm Maybe I am not using the scrips right, I added that to a npc that uses only ranged attacks, made sure to enable scrips in the settings tab but it is not despawning after attacking.
In the scripting GUI what does it say next to Language?
Hmm it appears to be empty, that could be the problem.
Now it says EMCAScript. but I now get a script error in chat every time it fires xD
Nm I got it to work I think, Thanks again, very helpful! I am just now sure if I am aloud to redistribute that jar.
I have no combat animations in the models are taken from third-party mods, what to do?
Thank's @daottoad for helping me earlier!. Forget the two player idea, that will take me too much work, instead, my map will just have a little extra stuff given just in case someone is playing with a friend.
Now I have another question if you have the time to answer it, if not its no problem.
My question is: Is is possible to script an NPC to change factions?
I have one NPC depending on what side you choose in my map Evil, Good or Indifferent, becomes an ally to you or not.
I have toiled over the scripting day and night, to the point I have decided I will just have the NPC's do small event's for most things until i understand scripting a bit more and use command blocks for many things as well. You guys are awesome for knowing all this stuff, but I can't handle work and then come home to try to learn all this at once.
You guys are the heroes here! Thank you for helping not just myself, but everyone who posts here!
Keep being Awesome! And Thank you Noppes for this MOD!
Thank you for taking the time to read my post. And for helping me tenfold!
I'm a bird flying higher than the sun. I am not the same or different.
I am Unique.
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1278956-custom-npcs?comment=24898
I am sorry to apply again.
I hope you can allow me to share your mod.
I think that you didn't see him. So I apply again.
(or am I later?)
That's mine.
the staffs should give potion effects
I am using 1.10.2. Pretty much any command I try in a command block doesn't work. For example, I type "/noppes npc SomeNPCName create" in chat it works fine. I do the same in a command block and I get an error (Screenshot).
I'm trying the 1.11.2 beta. I had the following crash when messing with the day/night NPC settings. I set the the time to night time and then the server crashed. Error below:
---- Minecraft Crash Report ----
WARNING: coremods are present:
CreativePatchingLoader (CreativeCore v1.7.0 mc1.11.2.jar)
LoadingPlugin (ChunkAnimator-MC1.11-1.2.jar)
LittlePatchingLoader (LittleTiles v1.4.6 mc1.11.2.jar)
MalisisCorePlugin (malisiscore-1.11.2-5.1.1.jar)
Contact their authors BEFORE contacting forge
// I feel sad now
Time: 4/2/17 10:08 PM
Description: Ticking entity
java.lang.NullPointerException: Ticking entity
at noppes.npcs.roles.JobFarmer.writeToNBT(JobFarmer.java:68)
at noppes.npcs.controllers.data.DataTransform.getJob(DataTransform.java:84)
at noppes.npcs.controllers.data.DataTransform.transform(DataTransform.java:207)
at noppes.npcs.ai.EntityAITransform.func_75249_e(EntityAITransform.java:29)
at net.minecraft.entity.ai.EntityAITasks.func_75774_a(SourceFile:102)
at net.minecraft.entity.EntityLiving.func_70626_be(EntityLiving.java:769)
at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:2255)
at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:573)
at noppes.npcs.entity.EntityNPCInterface.func_70636_d(EntityNPCInterface.java:388)
at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2085)
at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:296)
at noppes.npcs.entity.EntityNPCInterface.func_70071_h_(EntityNPCInterface.java:273)
at noppes.npcs.entity.EntityCustomNpc.func_70071_h_(EntityCustomNpc.java:35)
at net.minecraft.world.World.func_72866_a(World.java:1961)
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:840)
at net.minecraft.world.World.func_72870_g(World.java:1931)
at net.minecraft.world.World.func_72939_s(World.java:1747)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:621)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:720)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:384)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Server thread
Stacktrace:
at noppes.npcs.roles.JobFarmer.writeToNBT(JobFarmer.java:68)
at noppes.npcs.controllers.data.DataTransform.getJob(DataTransform.java:84)
at noppes.npcs.controllers.data.DataTransform.transform(DataTransform.java:207)
at noppes.npcs.ai.EntityAITransform.func_75249_e(EntityAITransform.java:29)
at net.minecraft.entity.ai.EntityAITasks.func_75774_a(SourceFile:102)
at net.minecraft.entity.EntityLiving.func_70626_be(EntityLiving.java:769)
at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:2255)
at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:573)
at noppes.npcs.entity.EntityNPCInterface.func_70636_d(EntityNPCInterface.java:388)
at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2085)
at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:296)
at noppes.npcs.entity.EntityNPCInterface.func_70071_h_(EntityNPCInterface.java:273)
at noppes.npcs.entity.EntityCustomNpc.func_70071_h_(EntityCustomNpc.java:35)
at net.minecraft.world.World.func_72866_a(World.java:1961)
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:840)
at net.minecraft.world.World.func_72870_g(World.java:1931)
-- Entity being ticked --
Details:
Entity Type: customnpcs:customnpc (noppes.npcs.entity.EntityCustomNpc)
Entity ID: 1015
Entity Name: Ethan
Entity's Exact location: 1906.50, 66.00, -476.27
Entity's Block location: World: (1906,66,-477), Chunk: (at 2,4,3 in 119,-30; contains blocks 1904,0,-480 to 1919,255,-465), Region: (3,-1; contains chunks 96,-32 to 127,-1, blocks 1536,0,-512 to 2047,255,-1)
Entity's Momentum: 0.00, -0.08, 0.00
Entity's Passengers: []
Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
at net.minecraft.world.World.func_72939_s(World.java:1747)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:621)
-- Affected level --
Details:
Level name: NewWorld
All players: 1 total; [EntityPlayerMP['vin0m'/80, l='NewWorld', x=1902.63, y=65.00, z=-469.51]]
Chunk stats: ServerChunkCache: 1138 Drop: 0
Level seed: 5995804518695279578
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options:
Level spawn location: World: (2394,25,-326), Chunk: (at 10,1,10 in 149,-21; contains blocks 2384,0,-336 to 2399,255,-321), Region: (4,-1; contains chunks 128,-32 to 159,-1, blocks 2048,0,-512 to 2559,255,-1)
Level time: 50192073 game time, 20000 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 1 (now: false), thunder time: 1 (now: false)
Level game mode: Game mode: adventure (ID 2). Hardcore: false. Cheats: false
Stacktrace:
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:720)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:384)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
at java.lang.Thread.run(Unknown Source)
-- System Details --
Details:
Minecraft Version: 1.11.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_111, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 1434109368 bytes (1367 MB) / 2971664384 bytes (2834 MB) up to 15271460864 bytes (14564 MB)
JVM Flags: 2 total; -Xms1G -Xmx16G
IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
FML: MCP 9.38 Powered by Forge 13.20.0.2228 30 mods loaded, 30 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJAAAA minecraft{1.11.2} [Minecraft] (minecraft.jar)
UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forge-1.11.2-13.20.0.2228-universal.jar)
UCHIJAAAA forge{13.20.0.2228} [Minecraft Forge] (forge-1.11.2-13.20.0.2228-universal.jar)
UCHIJAAAA creativecoredummy{1.0.0} [CreativeCoreDummy] (minecraft.jar)
UCHIJAAAA littletilescore{1.0.0} [LittleTilesCore] (minecraft.jar)
UCHIJAAAA bettercombatmod{1.4.0} [Better Combat] ([MC 1.11.X] BetterCombatMod 1.4.jar)
UCHIJAAAA examplemod{1.0} [examplemod] ([MC 1.11.X] BetterCombatMod 1.4.jar)
UCHIJAAAA achunkloader{1.11-1.2.0} [A Chunk Loader] (achunkloader-1.11.2-1.2.0.jar)
UCHIJAAAA animalbikes{1.11.2} [Animal Bikes] (AnimalBikes_1.11.2(24jan17).jar)
UCHIJAAAA baubles{1.4.3} [Baubles] (Baubles-1.11-1.4.3.jar)
UCHIJAAAA cfm{4.1.2} [MrCrayfish's Furniture Mod] (cfm-4.1.2-mc1.11.2.jar)
UCHIJAAAA chiselsandbits{13.10} [Chisels & Bits] (chiselsandbits-13.10.jar)
UCHIJAAAA creativecore{1.5.0} [CreativeCore] (CreativeCore v1.7.0 mc1.11.2.jar)
UCHIJAAAA customnpcs{1.11.2} [CustomNPCs] (CustomNPCs_1.11.2_beta(17mar17).jar)
UCHIJAAAA giacomos_bookshelf{1.1} [Giacomo's Bookshelves Mod] (GiacomosBookshelf-1.11.2-1.1.jar)
UCHIJAAAA gbook{1.5.0} [Guidebook] (Guidebook-1.11.0-1.5.0.jar)
UCHIJAAAA waila{1.8.12} [Waila] (Hwyla-1.8.12-B25_1.11.jar)
UCHIJAAAA journeymap{1.11.2-5.4.5} [JourneyMap] (journeymap-1.11.2-5.4.5.jar)
UCHIJAAAA littletiles{1.3.0} [LittleTiles] (LittleTiles v1.4.6 mc1.11.2.jar)
UCHIJAAAA malisiscore{1.11.2-5.1.1} [MalisisCore] (malisiscore-1.11.2-5.1.1.jar)
UCHIJAAAA malisisblocks{1.11.2-5.1.0} [Malisis Blocks] (malisisblocks-1.11.2-5.1.0.jar)
UCHIJAAAA malisisdoors{1.11.2-6.1.0} [MalisisDoors] (malisisdoors-1.11.2-6.1.0.jar)
UCHIJAAAA moreplayermodels{1.11.0} [MorePlayerModels] (MorePlayerModels_1.11.2(26jan17).jar)
UCHIJAAAA treechopper{1.1.2} [Tree Chopper] (TreeChopper-1.11.2-1.1.2.jar)
UCHIJAAAA variedcommodities{1.11.2} [Varied Commodities] (VariedCommodities_1.11.2(22jan17).jar)
UCHIJAAAA vmod{3.0} [VIN0M'S MOD] (vmod1.11.2-4.0.0.jar)
UCHIJAAAA warpshrines{1.0.1} [WarpShrines] (WarpShrines-1.11-1.0.1.jar)
UCHIJAAAA waystones{3.0.12} [Waystones] (Waystones_1.11.2-3.0.12.jar)
UCHIJAAAA worldedit{6.1.6} [WorldEdit] (worldedit-forge-mc1.11-6.1.6-dist.jar)
Loaded coremods (and transformers):
CreativePatchingLoader (CreativeCore v1.7.0 mc1.11.2.jar)
LoadingPlugin (ChunkAnimator-MC1.11-1.2.jar)
lumien.chunkanimator.asm.ClassTransformer
LittlePatchingLoader (LittleTiles v1.4.6 mc1.11.2.jar)
com.creativemd.littletiles.LittleTilesTransformer
MalisisCorePlugin (malisiscore-1.11.2-5.1.1.jar)
net.malisis.core.util.chunkcollision.ChunkCollisionTransformer
net.malisis.core.util.chunkblock.ChunkBlockTransformer
net.malisis.core.renderer.transformer.MalisisRendererTransformer
net.malisis.core.renderer.icon.asm.TextureMapTransformer
net.malisis.core.util.clientnotif.ClientNotifTransformer
Profiler Position: N/A (disabled)
Player Count: 1 / 20; [EntityPlayerMP['vin0m'/80, l='NewWorld', x=1902.63, y=65.00, z=-469.51]]
Is Modded: Definitely; Server brand changed to 'fml,forge'
Type: Dedicated Server (map_server.txt)
yes it was working in earlier versions - I think noppes know about it but you can remind him at
https://discord.gg/cBASshA
I am using custom npcs, and I am trying to make my NPC's have voice acting. Two questions
1. is it possible for me to use multiple folders to organise my sounds? I don't want my voice acting to be in the same place my music is, it will get jumbled and practically inaccessible.
and 2. I can see the file, I can select the file, but it will not play. I played it with and without streaming and it does not make any sound. It is in .OGG format. and by all accounts should be able to play, what am I doing wrong? This is the 1.10.2 version of the mod and I am using a sound pack someone else made as a guideline to how im supposed to code it, along with several tutorials.
its probably your sound sounds.json - going to have to see it to find the mistake - there can be 0 errors in a sounds.json
actually I don't think I ever got sounds to work in the customnpcs folder I put them in a resource pack under minecraft
\.minecraft\resourcepacks\1.10 Default Resource Pack\assets\minecraft
Would anyone mind helping me to update a few scripts to the new format for 1.10? I'm having a lot of trouble with the new API and it's the only thing keeping me from updating 1.7.
- This first script went under the killed tab to make a held item seem to disappear on death
npc.setRightItem(world.createItem('minecraft:air', 0, 1))
if(dialog == 474){
npc.setVisibleType(2);
}
if(dialog == 768){
npc.setVisibleType(1);
}
if(dialog == 437){
npc.setHome(-178,57,415);
}
if(dialog == 466){
npc.say(Listen!);
}
world.getTime();
if (!world.isDay())
{
npc.setHome(406,76,744);
}
else {
npc.setHome(405,70,744);
};
if(dialog == 651){
npc.executeCommand("/setblock 407 105 743 redstone_torch");
npc.executeCommand("/setblock 408 105 743 redstone_torch");
npc.executeCommand("/setblock 408 105 742 redstone_torch");
npc.executeCommand("/setblock 407 105 742 redstone_torch");
}
if(dialog == 826){
npc.setReturnToHome();
}
if(dialog == 231){
npc.despawn();
world.spawnClone(-203.56,35,720.77,1,"Marv_Slayable");
}
Daottoad's unlimited trader script, went under the dialog closed tab
if (option == 3) {
var coin1 = world.createItem("customnpcs:npcCoinIron", 0, 3);
var item1 = world.createItem("minecraft:stone_pickaxe", 0, 1);
npc.getRole().setSellOption(0, coin1, item1);
}
if (option == 4) {
var coin1 = world.createItem("customnpcs:npcCoinBronze", 0, 13);
var item1 = world.createItem("minecraft:gunpowder", 0, 1);
npc.getRole().setSellOption(0, coin1, item1);
var coin1 = world.createItem("customnpcs:npcCoinBronze", 0, 3);
var item1 = world.createItem("minecraft:stick", 0, 2);
npc.getRole().setSellOption(3, coin1, item1);
npc.getRole().removeSellOption(1);
npc.getRole().removeSellOption(2);
npc.getRole().removeSellOption(4);
npc.getRole().removeSellOption(5);
npc.getRole().removeSellOption(7);
npc.getRole().removeSellOption(8);
npc.getRole().removeSellOption(10);
npc.getRole().removeSellOption(11);
npc.getRole().removeSellOption(12);
npc.getRole().removeSellOption(13);
npc.getRole().removeSellOption(14);
npc.getRole().removeSellOption(15);
npc.getRole().removeSellOption(16);
npc.getRole().removeSellOption(17);
}
“I know there's a proverb which that says 'To err is human,' but a human error is nothing to what a computer can do if it tries.”
― Agatha Christie, Hallowe'en Party
Ok, well to get you started here is the first little one
function died(event) {
event.npc.setMainhandItem(null);
}
all the commands have to be in a function and the event of that function is what is acting on the commands and some of the command names have changed
Here I outline a few of the changes - you need to change all of them!
function dialog_option(event) {
//option has changed to event.option.getSlot()
if (event.option.getSlot() == 3) {
//everything begins with event - usually - event.npc.... event.block.... event....
var coin1 = event.npc.world.createItem("customnpcs:npcCoinIron", 0, 3);
//setSelloption is now just set - and you can just say role
event.npc.role.set(0, coin1, item1);
//.....
}
see if that works and get back to me
The first script works great, but the trader one is still throwing errors.
“I know there's a proverb which that says 'To err is human,' but a human error is nothing to what a computer can do if it tries.”
― Agatha Christie, Hallowe'en Party