#Fence and Fence Gate Template

1 messages · Page 1 of 1 (latest)

faint epoch
#

Here is some simple fence and fence gate .block.json and .geo.json files.
The fence gates only open facing away from the direction it was originally placed (so not 100% vanilla-like).
You can just add the .js code into your main file. It controls the opening of the fence gate.

Updated code: #1479877494453571866 message

faint epoch
#

Currently trying to make some updates to this

covert remnant
#

I noticed that his connection only has the "only fences" filter, but no position filter, meaning it connects to all sides?

faint epoch
#

Vanilla I only realised after making it that fences also connects to the front and back of fence gates

atomic valley
#

i could be wrong but the fence gate doesn’t seem to show up in game for me

covert remnant
faint epoch
#

I'll see what I can do

thorny mirage
#

its not even showing up in my creative inventory

#

the fence is

covert remnant
thorny mirage
#

oh

#

the custom fence gate isnt working for me

#

pretty sure because of the ""dma:fence_gate": []," line

faint epoch
#

You need the script also

#

the main.js file

#

@thorny mirage

faint epoch
faint epoch
covert remnant
faint epoch
faint epoch
#

For some reason sometimes the custom fence looks smaller

#

But when compared to the proper bamboo model, it looks the exact same

#

So I don't think that needs to be edited

covert remnant
faint epoch
thorny mirage
#

its saying like "| components | dma:fence_gate | []" and "| components | dma:fence_gate | child 'dma:fence_gate' not valid here."

faint epoch
thorny mirage
#

i did

#

i still get that error

faint epoch
thorny mirage
#

yeah

faint epoch
#

Did you add this to the manifest under "modules"?

{
  "uuid": "017bb48d-856c-4a4e-8f3f-767f26b2980d",
  "version": "1.0.0",
  "type": "script",
  "language": "javascript",
  "entry": "scripts/main.js"
        }```
thorny mirage
#

yeah

#

"type": "script",
"language": "javascript",
"uuid": "1156747b-4d0e-451c-94a3-9ad8d2401dc2",
"version": [1, 0, 0],
"entry": "scripts/main.js"

#

wait howd you send it as code

faint epoch
#

` encase it with 3 of those at the front and end

#

It'll make a code block

thorny mirage
#

ohhh

#

bet

upper canyon
#

it even broke all my existing scripts

#

for the block instead, i had to use the old format of the custom component, as it wasnt appearing ingame at all

faint epoch
#

At least that was the one I was using when making it. You can try 2.5.0, but I think there's one thing that is still in beta

upper canyon
#

wont that break all the other scripts im using? as im using 1.17.0

faint epoch
#

Ah you're way behind 😭

upper canyon
#

😭

#

yeah

faint epoch
#

No wonder it won't work then 😅

#

You should upgrade. It'll allow you to do so much more than what you can in 1.17.0

upper canyon
#

yeah but i pretty much dont need any of the new stuff 👉👈

faint epoch
#

Understandable

upper canyon
#

would it break the existing scripts if i update it?

#

the version thingy

#

idk how scripting works, i just dont want to break anything 🙏

faint epoch
#

It shouldn't

#

Ik there was a big change in one of the subscribes. I think it was onLoad or something like that

upper canyon
#

hmm

upper canyon
#

server or server ui

faint epoch
#

Server

#

Make sure you install the updated module

upper canyon
faint epoch
upper canyon
faint epoch
#

What code editor do you use?

upper canyon
#

no one

#

i type the stuff

faint epoch
#

Are you using a phone or PC?

upper canyon
#

pc

faint epoch
#

open up node.js app

#

Oop, sorry

#

Open up powershell

#

Or cmd

upper canyon
faint epoch
#

Wait

#

That's the wrong module

#

woops

#

There

#

Didn't realise the other was ui 😅

upper canyon
faint epoch
#

Yes

upper canyon
# faint epoch Yes

it says:
"npi" is not reconized as an internal or external exe program or batch file

faint epoch
#

do you have node JS installed?

upper canyon
#

no

#

i dont think so

faint epoch
#

Ah

upper canyon
#

still doesnt work

faint epoch
#

I have no idea then 😭

upper canyon
#

do i type it like this? 😭

faint epoch
#

yes

upper canyon
faint epoch
#

Do you have the geometry file

upper canyon
#

the blocks that use scripting no longer work, and the fence block doesnt even appear ingame

upper canyon
faint epoch
#

Hmm

upper canyon
#

it just doesnt work

faint epoch
#

I'm as confused as you 😭

#

It works fine on my end

upper canyon
# upper canyon

the block vanishes only when i put the new format of the custom component

#

and if i use the old one, it appears ingame but has no function

faint epoch
#

The "minecraft:custom_components" is no longer a valid component

#

You just need the first iamge

#

image*

#

Remove the component in the 2nd image completely

upper canyon
faint epoch
#

Can you show me the full file?

upper canyon
#

thats what causes the block to no longer appear ingame

upper canyon
faint epoch
#

Are you sure you have the fence_gate geometry??

faint epoch
#

What experimental features do you have on?

#

It works for me

#

I just changed the texture as I don't have it

upper canyon
faint epoch
#

I have no idea what's wrong with yours then 😭

upper canyon
#

now for example, i have set the old format of that component

#

and look, it appears just normal 😭

#

but no functionality

faint epoch
#

;-;

faint epoch
upper canyon
#

its ok, i dont need help anymore, i fixed the issue my self by editing the script a little and the block code

#

thanks anyway

faint epoch
#

Oh

#

Good!

upper canyon
#

:D

#

thanks again for the help

#

:)

atomic valley
#

i dont understand why im getting it and other people arent

ashen flicker
#

basically :
by updating to scripting 2.0, a lot of stuff changes and will break untill you update it, namely
ApplyKnockback
.isValid()
and custom components

the new custom components component method will also require the block format version to be higher

atomic valley
atomic valley
ashen flicker
atomic valley
#

cause that’s what mines at yet i’m still have the same problem as him

ashen flicker
atomic valley
#

it gives me like 3 errors related to it and doesn’t even show the block in game

#

and just like the other guy

#

if i comment it out, put it in custom component, or delete it

#

it works but has no functionality

faint epoch
#

What is your manifest file like?

faint epoch
#

Ahh, that's why

#

Change server to 2.5.0

#

Then download that NPM

thorny mirage
#

in dependencies?

#

(is it bad that I dont know how to use npm or basically any of what you said there? 😭 )

faint epoch
atomic valley
faint epoch
#

Ok, either way, you shouldn't need it installed to have it run properly in-game

#

So you can just put "version": "2.5.0" in the server module

atomic valley
#

oh

#

yeah that didnt work

#

i tried that back when I still had the files (they are on my school computer cause this is for one of my classes)

onyx hull
#

time to add redstone support..

faint epoch
tacit ivy
covert remnant
faint epoch
covert remnant
#

But visually, in the commands and in the UI Pocket, it's wrong.

faint epoch
#

Then I am as confused as you

covert remnant
faint epoch
#

Ohhhh

#

Lmao

#

Now I understand 🤣

#

I thought only the first fence gate and fence were being registered is what you meant 😭

#

But yes, I believe there is a fix. And that will be in an updated template (whenever I get around to doing it)

potent kraken
sleek jewel
#

where is the item visual located for the fence gate in the pack, assuming there is one?

faint epoch