Sweet! Now I might actually start using 1.10 forge XD
Rollback Post to RevisionRollBack
Goodbye, Minecraft forums. If any of ya'll future people persons need to contact me for whatever dumb reason, my discord is EnderDude124#8340 as of 6/8/2019. Send me a message, I like a good chat.
Does anyone know of a script that would cause an npc to attack the player (change faction) based on the current armour worn by the player?
well for 1.8.9 you could do this
function tick(event) {
var x = event.npc.getX();
var y = event.npc.getBlockY();
var z = event.npc.getBlockZ();
if (event.npc.world.getNearbyEntities(x, y, z, 5, 1).length > 0) {
for (var i = 0; i < event.npc.world.getNearbyEntities(x, y, z, 5, 1).length; i++) {
if (event.npc.world.getNearbyEntities(x, y, z, 5, 1).getArmor(3).name != null) {
if (event.npc.world.getNearbyEntities(x, y, z, 5, 1).getArmor(3).name == "customnpcs:npcFullIronHead") {
event.npc.setFaction(2);
}
}
}
} else {
event.npc.setFaction(0);
}
}
when you get 5 blocks near him wearing a full Iron Head helmet (from CNPC) he goes hostile if you get out of that range he goes back to friendly. you could string together a few comparisons to check for other pieces of armor too.
(I used getX instead of getBlockX because that's broke and will give you the Z coord. -- Grrr... I like using getBlock because it will give a whole number)
function tick(event) {
var x = event.npc.getX();
var y = event.npc.getBlockY();
var z = event.npc.getBlockZ();
if (event.npc.world.getNearbyEntities(x, y, z, 5, 1).length > 0) {
for (var i = 0; i < event.npc.world.getNearbyEntities(x, y, z, 5, 1).length; i++) {
if (event.npc.world.getNearbyEntities(x, y, z, 5, 1).getArmor(3).name != null) {
if (event.npc.world.getNearbyEntities(x, y, z, 5, 1).getArmor(3).name == "customnpcs:npcFullIronHead") {
event.npc.setFaction(2);
}
}
}
} else {
event.npc.setFaction(0);
}
}
when you get 5 blocks near him wearing a full Iron Head helmet (from CNPC) he goes hostile if you get out of that range he goes back to friendly. you could string together a few comparisons to check for other pieces of armor too.
(I used getX instead of getBlockX because that's broke and will give you the Z coord. -- Grrr... I like using getBlock because it will give a whole number)
I'm creating a farming modpack with ponies and quests, but I'd like some of them to actually farm.
This mod is best mod, and I'm going to use MineLP (like to find a way to override it's player model with the default)
Yes, anon with farming ponies, but I've barely used javascript in my life.
Really, any scripts would help me learn, but this is mainly what I want.
Make a position as home and hang around or go back to it at night
within a range around home, turn dirt that is near water into farmland
plant seeds on the land from inventory
collect plants and seeds when they are grown and add them to inventory
maybe bonemeal seeds
put said items in chest.
maybe modify some stats based upon dialog choices/items given.
Give items to npc
change dialog choices based upon variable values
maybe even add hunger.
I'd also like to make a calendar and seasons, maybe cause it to snow/rain or even change npc inventories based upon season.
I know it's a lot, but I'd learn scripting easier if I had several examples or tutorials, or a way to get item values. I can't even kill a simple pony just by speaking to her.
I have a question regarding the custom blocks in the mod, like chairs, tables etc. Is there any way to change the materials of these blocks? Like is it possible to edit the code so that a chair is made of clay and stone instead of wool and planks?
I have a question regarding the custom blocks in the mod, like chairs, tables etc. Is there any way to change the materials of these blocks? Like is it possible to edit the code so that a chair is made of clay and stone instead of wool and planks?
Help would be greatly appreciated!
You can change the textures in Photoshop, or Gimp or any other graphics/draw program.
I use Photoshop. You copy out the textures from the jar file, use winzip to open up the jar file.
Then place the textures you want to edit in a folder. Open them up with your program and edit them and save them as they are.
Png and interlace none
Copy back the textures you have made, and ur done.
You can also make a folder in your resourcepack, /assets/customnpc
Put the textures in there as well. Now your resourcepack has texture support for Customnpc
I have a question regarding the custom blocks in the mod, like chairs, tables etc. Is there any way to change the materials of these blocks? Like is it possible to edit the code so that a chair is made of clay and stone instead of wool and planks?
Help would be greatly appreciated!
Resource pack methods such as what Triliton described will work with everything that has its own custom textures within the mod file, which majority of the furniture doesn't (most furniture takes it's textures from the game files. This means if any resource pack is loaded which has custom wood for example, will apply that wood texture on chairs, benches, tables etc).
The code could possibly be modified to force the furniture to take textures from a custom directory in the mod file (in this case you would have to add it), or could be made to take a different game texture file instead, such as stone as you suggested. Any changes like this (ie, any code changes) you would have to make yourself, and could only be for personal use.
If you require aid with Custom NPC's give me a shout (In the thread, not PM's). I can read a bit of error reports, know most of the NPC workings (I'm attempting to work on scripting) and have been using it since its 1.0 version. Otherwise I'll help with any questions or problems I can.
*Fingers crossed*
^^^^^^^^
This is the greatest mod ever
Are we sure? The last activity on Github was in May.
Noppes uses Discord. Ive talked to him there many many times.
Do you know if he has any plans to release an update to 1.10 soon? or is he sticking with 1.9 for a little while?
Considering the latest version is 1.9 beta, I'd say if anything, he's probably going to update to 1.9.4, but Idk.
Not to be a bother, but have you talked to him in the last 4 months? And could we expect a 1.9.4 beta anytime soon?
Quote from Noppes: this week there will be a 1.10 beta
I just talked to him.
Noppes said: this week there will be a 1.10 beta
version?
Sweet! Now I might actually start using 1.10 forge XD
Goodbye, Minecraft forums. If any of ya'll future people persons need to contact me for whatever dumb reason, my discord is EnderDude124#8340 as of 6/8/2019. Send me a message, I like a good chat.
Awesome! Thank you very much, I was just trying to figure out if I should be planning to keep my Minecraft in 1.9 for much longer
well for 1.8.9 you could do this
function tick(event) {
var x = event.npc.getX();
var y = event.npc.getBlockY();
var z = event.npc.getBlockZ();
if (event.npc.world.getNearbyEntities(x, y, z, 5, 1).length > 0) {
for (var i = 0; i < event.npc.world.getNearbyEntities(x, y, z, 5, 1).length; i++) {
if (event.npc.world.getNearbyEntities(x, y, z, 5, 1).getArmor(3).name != null) {
if (event.npc.world.getNearbyEntities(x, y, z, 5, 1).getArmor(3).name == "customnpcs:npcFullIronHead") {
event.npc.setFaction(2);
}
}
}
} else {
event.npc.setFaction(0);
}
}
when you get 5 blocks near him wearing a full Iron Head helmet (from CNPC) he goes hostile if you get out of that range he goes back to friendly. you could string together a few comparisons to check for other pieces of armor too.
(I used getX instead of getBlockX because that's broke and will give you the Z coord. -- Grrr... I like using getBlock because it will give a whole number)
Doat: hows ur health, any better?
Better -- just tired - thanks
Good to hear that.
Looking for some scripting help in 1.8.9.
I'm creating a farming modpack with ponies and quests, but I'd like some of them to actually farm.
This mod is best mod, and I'm going to use MineLP (like to find a way to override it's player model with the default)
Yes, anon with farming ponies, but I've barely used javascript in my life.
Really, any scripts would help me learn, but this is mainly what I want.
Make a position as home and hang around or go back to it at night
within a range around home, turn dirt that is near water into farmland
plant seeds on the land from inventory
collect plants and seeds when they are grown and add them to inventory
maybe bonemeal seeds
put said items in chest.
maybe modify some stats based upon dialog choices/items given.
Give items to npc
change dialog choices based upon variable values
maybe even add hunger.
I'd also like to make a calendar and seasons, maybe cause it to snow/rain or even change npc inventories based upon season.
I know it's a lot, but I'd learn scripting easier if I had several examples or tutorials, or a way to get item values. I can't even kill a simple pony just by speaking to her.
nvm, event.npc.setHealth(0) killed Octavia.
Thanks.
I have a question regarding the custom blocks in the mod, like chairs, tables etc. Is there any way to change the materials of these blocks? Like is it possible to edit the code so that a chair is made of clay and stone instead of wool and planks?
Help would be greatly appreciated!
You can change the textures in Photoshop, or Gimp or any other graphics/draw program.
I use Photoshop. You copy out the textures from the jar file, use winzip to open up the jar file.
Then place the textures you want to edit in a folder. Open them up with your program and edit them and save them as they are.
Png and interlace none
Copy back the textures you have made, and ur done.
You can also make a folder in your resourcepack, /assets/customnpc
Put the textures in there as well. Now your resourcepack has texture support for Customnpc
Resource pack methods such as what Triliton described will work with everything that has its own custom textures within the mod file, which majority of the furniture doesn't (most furniture takes it's textures from the game files. This means if any resource pack is loaded which has custom wood for example, will apply that wood texture on chairs, benches, tables etc).
The code could possibly be modified to force the furniture to take textures from a custom directory in the mod file (in this case you would have to add it), or could be made to take a different game texture file instead, such as stone as you suggested. Any changes like this (ie, any code changes) you would have to make yourself, and could only be for personal use.