#How do i make my item only placeable on specific blocks?
1 messages · Page 1 of 1 (latest)
I want to make the lever placeable for example on a dirt block but i have no idea how
First you can just do on join give player lever
No? I don't wanna give all players a lever only the player who joined
oh i'll just change it ig
Also try the on place event
It's gotta work with adventure mode
Then maybe
Do a right clicl event and if the clicked block is dirt and player is holding lever it places a lever at the location
on right-click with lever:
if right-clicked block is dirt:
place lever at location
else:
cancel event
Uh what
isnt that NBT stuff?
like the can be placed on or can break?
Yeah
this is not the on place event
and you still arent using code blocks
```code here```
d/d
I'll just use console
Why did you add - between stufd
a google search yielded this:/give @p diamond_pickaxe 1 0 {"minecraft:can_destroy":{"blocks":["stone"]}} /give @p diamond_block 1 0 {"minecraft:can_place_on":{"blocks":["stone"]}}i guess use skbee and NBT to apply them
make console execute command "give %player% stone{CanPlaceOn:["minecraft:grass","minecraft:dirt"]}"
i tried this but it didn't work for some weird reason?
I don't know ðŸ˜
you literally skipped half the syntax
i would use skbee though
console commands are a crude shortcut
cause you have quotes in the command
theres docs, wiki, and plenty of tutorials
You don't need console cmds for nbt if you have skbee
give player lever with nbt from "insert nbt here"
Also, any text within quotations is a string. When you want quotations inside the string (quotations within quotations), you need to double the quotations inside the quotations.
Quotations.
Example:
I want to broadcast this string with quotation marks inside of it.
broadcast "the npc said, "poo""
Doubling the quotation marks in the string:
broadcast "the npc said, ""poo"""
Notice the outer quotations are not doubled
you need to double " % #
That too
there's a vanilla mc thing for that
ah, I'm late once again