#How can I make a new block?
1 messages · Page 1 of 1 (latest)
If the geometry is smaller or equal to 30x30x30 pixels, yes
Otherwise no
Happy to help
Since you don’t have much experience I’d make an entity
Hi Dark, I am a newbie myself, but I´ve come to know how to do this:
All you have to do is
- choose if you want a block or entity (you can use either)
- if you want to make your beautiful model a block (which is more work but better imo), then (which by the looks of your model) it seems to be over the limit, do this: Make sure your model height is not over 30 pixels. If it is higher just lower it and adapt the texture accordingly.
Next, you will have to split your model in 2 halves. (left half and right half) - Wardrobe_L and Wardrobe_R (let´s pretend each model is 16 pixels wide and 30 pixels tall...
So after you create both versions, when you place them in the world, just place them side by side and it will make a full wardrobe!
If you need all the steps, just let me know and I will send them to you tomorrow.
Lastly if you make it an entity then you have no problems. Just make it and it will work.
The only bad thing is rotation.... and this part I do not know the answer to because like I said, I am a newbie and I do not code. So because of this, if I place an entity down as a furniture, it will always rotate in several angles instead of pure perfect 90 degrees (which is not what we want).
The advantage of blocks is this problem does not happen as they only have 4 perfect 90 degrees facing.
if anyone knows how we can place entities like blocks facing only 4 directions (facing the player, like we can with blocks) let me know and I will stand up and applaud you Sir! 😄
Well to close it up if you really want your model as a block but want to still keep its height above the limit, then you will need to split your model in 4 parts instead of 2 (left_bottom, left_top, top_right, bottom-right
You can use the cardinal_direction trait. I’m on my phone so I really don’t have the ability to show you how it works
But the wiki does exist for a reason you know
I’ll grab the specific wiki article you’d need
yeah but answers are like where? only people who knows like you can guide us in the right direction
thank you! i´ll come back and check too! 🙂
This has all you need under “cardinal direction”
wait but this is for an entity right?
ayyyyyy block I already know 😄
Entity is just a quicker way to get a large model placed down. If you wanted to make the block better you could go down the rabbit hole of scripting and custom components to a make a block that would place both halves in the proper direction and what not
yeah great idea, blocks are much more performance friendly huh
Yeah
I might make a template for this if I ever have the time
If you think about it, it’s basically a bed lmao
problem is we can´t animate a block like rotate a ceiling fan.. or if we make a fridge block we can´t make it door open correct?
You can actually
It needs scripting though
oops see since scripting is like telling me read a book.. the best is to point us towards the specifics we will need to learn to do Just that... because or else we will spend months having to learn so much undeeded stuff til we can go and make what we really want...
That´s why templates are a great go...
gosh it´s 1:20am i gott go to sleep 😄 I will read your last comment and go, lol (I´m just saying this to my self though)
For the ceiling fan you need to (not great explanation sorry)
- Make models for each rotation
- Make a state in your block(number ex. 1-12)
- Make permutations that checks that state
- In each permutation set the geometry to rotation geometry
- Make a custom block component that has onTick, then increment the state(I can show you an example in a few days when I’m at my pc)
It’s a bit complicated
ah so it involves multiple rotated blocks models huh
For a fridge it’s less complicated since you only need 2 models that are switched when interacted with
Nah just 1 block
The permutation is just a “variant” in that one block. The state is a value of that block that determines which variant is used. Each variant has a different 3D model.
right
The rotated blocks example has a different block rotation in each variant instead of a different 3D model
interesting! alright off to bed I go I will check in coming days for your template! but this was great to know though anyhoos!
See ya
will do soon (just woke up)
by the way where can I begin with? because like up to where do you know how to do? or which part would you like me to begin with?
ok let´s chat on to it
in blockbench what is the size of your model? height and width in pixels
because you know you need to keep the model in the same pixel size as the texture 😉 to be faithful to default MC looks
if you´d like, you can send me he model and I can look at it and figure out how to resize it for you appropriately
oh ok, no problem! later let me know when you can come back so we can be together so i can show you
Let meknow if it is ok for your model to be like this, because all I had to do is bring it down 2 pixels in height and now you can use it with just ONE full block model! no need to split it.
Because now it is not exceeding the 30x30x30 limit asfaik
Here it is! now you do not have to split the model in 2. You can use it like this as a full block asfaik! I have a modern wardrobe too that I made for my free addon 🙂 - I called it the same name but in Brazilian portuguese
whenever you make another model that will have to be bigger than the allowed block limit, but still need to be a block, let me know and I will teach you how to split the model correctly!
Why not just use a flipbook texture for the on state and a normal one for the off state instead of having a bunch of permutations you can have just two
That's what I did with my ceiling fan
Would also work for 3d if you know what you're doing
It's just less strain to handle block animations as flipbook and not permutations
I'm late, but I have the answer you are looking for, yes, it is possible to rotate your entity at perfect angles and as a bonus, make the shadow of the entity disappear.
This is an entity: https://vm.tiktok.com/ZMrSFnhuu/
Great, though that just showed an animation which is not what I´m after, plus, this does not explain how the entity got perfectly angled either N,E,S,W, neither says what addon does this, so we are still left dead on the tracks
The entity is the wall, which is perfectly aligned with the blocks, that's what I meant, an entity can be configured to impersonate a block by adapting the rotation.
right, great, I am just spending over an hour here, tried functions, tried many jsons and still no luck.. I wonder if there is an addon that does that, will see
misaligned
"format_version": "1.8.0",
"minecraft:entity": {
"description": {
"identifier": "vvelha:estante",
"is_spawnable": true,
"is_summonable": true,
"is_experimental": false
},
"components": {
"minecraft:type_family": {
"family": [
"furniture"
]
},
"minecraft:scale": {
"value": 1.0
},
"minecraft:collision_box": {
"width": 1,
"height": 1
},
"minecraft:physics": {},
"minecraft:pushable": {
"is_pushable": false
},
"minecraft:health": {
"value": 1,
"max": 1
},
"minecraft:knockback_resistance": {
"value": 999,
"max": 999
}
},
"events": {
"facing_south": {
"run_command": {
"command": [
"tp @s ~ ~ ~ facing ~ ~ ~-1"
]
}
},
"facing_west": {
"run_command": {
"command": [
"tp @s ~ ~ ~ facing ~1 ~ ~"
]
}
},
"facing_east": {
"run_command": {
"command": [
"tp @s ~ ~ ~ facing ~-1 ~ ~"
]
}
}
}
}
}```
It is only necessary to have knowledge of entity animation, since to establish the rotation, you need to add an animation that detects where the player is looking and thus establishes the position of the entity based on that.
"loop": true,
"animation_length": 3,
"bones": {
"head": {
"rotation": {
"0.0": [2.5, 0, 0],
"1.5": [0, 0, 0],
"3.0": [2.5, 0, 0]
}
},
"hat": {
"rotation": {
"0.0": [0, 0, 0],
"0.5": [0, 0, 0],
"1.0": [0, 0, 0]
}
},
"leftArm": {
"rotation": {
"0.0": [0, 0, 0],
"1.5": [0.09776, -0.47873, -2.4522],
"3.0": [0, 0, 0]
}
},
"rightArm": {
"rotation": {
"0.0": [0, 0, 0],
"1.5": [0, 0, 2.5],
"3.0": [0, 0, 0]
}
},
"bod": {
"scale": {
"0.0": [1, 1, 1],
"1.5": [1, 1, 1.1],
"3.0": [1, 1, 1]
}
},
"all": {
"rotation": [
0,
"-q.body_y_rotation+(math.round(q.body_y_rotation/90)*90)",
0
]
}
}
},
well I have made an animation for the 4 directions and have created thus an animation controller, edited the behavior json and made the animation file
Pay attention to this specific line:
0,
"-q.body_y_rotation+(math.round(q.body_y_rotation/90)*90)",
0
]
It's what makes rotation work.
ok I will see to implement that... will let you know if worked
but wait sorry this goes into animation file or animation controller file in the BP folder?
You must implement that animation as a base, so that when the entity spawns, that animation is immediately executed and it rotates
As I said, it has to be in the animation that runs first when spawning the entity, it goes in the animation file, not in the controller.
perfect ok
this is how it is set in Blockbench
and the animatin file: ```{
"format_version": "1.8.0",
"animations": {
"animation.estante.idle": {
"loop": false,
"bones": {
"Estante": {
"rotation": [0, 0, 0]
},
"all": {
"rotation": [
0,
"-q.body_y_rotation + (math.round(q.body_y_rotation / 90) * 90)",
0
]
}
}
}
}
}
Change the "all" to the name of a folder of your model, you must put your complete model inside a folder, that is to say... in blockbench create a folder in your model and put all your bones and folders in that new folder, I recommend calling it "all" so you avoid changing the name in the code I just gave you.
Look at this
I have everything that is the model, inside the "all" folder
And the animation makes everything inside the "all" folder rotate based on where the player is looking.
ok let me go back and readjust
It threw this error, but I guess we are almost there! 😄
[Animation][error]-C:/Users/Micro/AppData/Local/Packages/Microsoft.MinecraftUWP_8wekyb3d8bbwe/LocalState/games/com.mojang/development_resource_packs/Vila_Velha-RP/animations/estante.animation.json | animations | animation.estante.idle | all | child 'all' not valid here.
Below is the animation file
"format_version": "1.8.0",
"animations": {
"animation.estante.idle": {
"loop": false,
"all": {
"rotation": [
0,
"-q.body_y_rotation + (math.round(q.body_y_rotation / 90) * 90)",
0
]
}
}
}
}
}
Use this:
{
"format_version": "1.8.0",
"animations": {
"animation.estante.idle": {
"loop": false,
"bones": {
"all": {
"rotation": [
0,
"-q.body_y_rotation + (math.round(q.body_y_rotation / 90) * 90)",
0
]
}
}
}
}
}
Hahaha it should work now.
didn´t work 😦
maybe it´s my entity json behavior hold on
here is the behavior -is it still ok?: { "format_version": "1.8.0", "minecraft:entity": { "description": { "identifier": "vvelha:estante", "is_spawnable": true, "is_summonable": true, "is_experimental": false }, "components": { "minecraft:type_family": { "family": [ "furniture" ] }, "minecraft:scale": { "value": 1.0 }, "minecraft:collision_box": { "width": 1, "height": 1 }, "minecraft:physics": {}, "minecraft:pushable": { "is_pushable": false }, "minecraft:health": { "value": 1, "max": 1 }, "minecraft:knockback_resistance": { "value": 999, "max": 999 } }, "events": { "facing_south": { "run_command": { "command": [ "tp @s ~ ~ ~ facing ~ ~ ~-1" ] } }, "facing_west": { "run_command": { "command": [ "tp @s ~ ~ ~ facing ~1 ~ ~" ] } }, "facing_east": { "run_command": { "command": [ "tp @s ~ ~ ~ facing ~-1 ~ ~" ] } } } } }
Once this is fixed this will make ao so happy, no errors this time though
That doesn't seem to have anything wrong
Show me the file. Your entity.
From ResourcePack
Ok
"format_version": "1.10.0",
"minecraft:client_entity": {
"description": {
"identifier": "vvelha:estante",
"materials": {
"default": "entity_alphatest"
},
"textures": {
"default": "textures/entity/estante"
},
"geometry": {
"default": "geometry.estante"
},
"render_controllers": [
"controller.render.furniture"
],
"spawn_egg": {
"base_color": "#FFFFFF",
"overlay_color": "#C0C0C0"
}
}
}
}
so please can you send me the added info? I don´t know how to write that in 😭
"format_version": "1.10.0",
"minecraft:client_entity": {
"description": {
"identifier": "vvelha:estante",
"materials": {
"default": "entity_alphatest"
},
"textures": {
"default": "textures/entity/estante"
},
"geometry": {
"default": "geometry.estante"
},
"render_controllers": [
"controller.render.furniture"
],
"spawn_egg": {
"base_color": "#FFFFFF",
"overlay_color": "#C0C0C0"
},
"animations": {
"rot": "animation.estante.idle"
},
"scripts": {
"animate": [
"rot"
]
}
}
}
}
Usa ese
use that
Are you recharging the world?
yes I restart the world
Try the addon in a new world.
ok
still
i will send you the 3 files so you see all is correct
behavior animation and entity
Okey
You don't speak Spanish?
Yes I speak 3 languages
I use the translator because I only speak Spanish hahaha
I send you the files again with the small correction I made to them.
Wow puedes hablar conmigo em Espanol in dm
Okay okay, let's talk Dm because we already filled this space Haha
Hey, I am back to do some things! first to thank @wise dragon for the kindness, patience and good heart to help me. Second, to say I payed a friend of mine who I knows well and that understands a lot and he made the json files for me and after some talk over how to implement it to other entities, all my entities are facing me (the player) and they even animate when placed which is cute. So I am very happy with this because I have several big furniture and models such as barraks and park stuff that need this functionality.
So Second, I am sharing here with you all who may need it! you only need a behavior json and an animation controller json. Here they are (examples) enjoy 🙂 - oh btw, they are for 1.20.81 - I do not know if these work on 1.21