#help-development
1 messages · Page 2070 of 1
there are many ways, reliably only client side
a right click with nothing in your hand? no you can't detect that
Also the vanilla client doesn't send a packet on right clicking air without an item in their hand
not playerinteract entitydamagebyentityevent
I simply don't believe that, let me doublecheck
@EventHandler
public void onSnowballHit(EntityDamageByEntityEvent e) {
if ((e.getDamager() instanceof Snowball))
if ((e.getEntity() instanceof Player)) {
double damage = 0.01;
e.setDamage(damage);
Projectile projectile = (Projectile) e.getEntity();
Player attacked = (Player) e.getEntity();
ProjectileSource ps = ((Snowball) e.getDamager()).getShooter();
if (!(ps instanceof Player)) {
return;
}
Player shooter = (Player) ps;
ArrayList<java.lang.String> lore = new ArrayList<>();
lore.add("This balls can freeze a player");
if (projectile instanceof Snowball) {
if (shooter.getInventory().getItemInMainHand().getItemMeta().getLore().equals(lore)) {
attacked.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 60, 20, true));
attacked.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 60, 100, true));
}
}
}
} this code doesnt work
maybe your code is wrong then
well thats the same, if the item is equal to the item you want then do nothing, if not setCancelled(true);
this code doesnt work
are snowballs entities?
interesting
what else would they be? 😄
public class SimpleCommandMap implements CommandMap {
protected final Map<String, Command> knownCommands = new HashMap<String, Command>();
why cant i get the knownCommands field with reflection
you can
SimpleCommandMap.class.getDeclaredField("knownCommands")
well they are listed as a material and particle
no problem at all
declaration: package: org.bukkit.entity, interface: Snowball
Hi this code do not word
https://paste.md-5.net/ufugoricin.java
pls help me
but
declaration: package: org.bukkit, enum: Material
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
SimpleCommandMap commandMap = ((CraftServer) Bukkit.getServer()).getCommandMap();
//commandMap.clearCommands();
//commandMap.getCommand("op").unregister(commandMap);
try {
final Field f = commandMap.getClass().getDeclaredField("knownCommands");
f.setAccessible(true);
@SuppressWarnings("unchecked")
Map<String, Command> cmds = (Map<String, Command>) f.get(commandMap);
cmds.remove("op");
f.set(commandMap, cmds);
} catch (Exception e) {
e.printStackTrace();
}
[19:56:23] [Async Chat Thread - #3/WARN]: java.lang.NoSuchFieldException: knownCommands
no no no
you used getClass() instead of class
getClass() probably returns a CraftCommandMap or similar
use the code I sent and it will work 100% fine
hmm
I know
Field field = SimpleCommandMap.getDeclaredField("commandMap");
Map<String,Command> commands = field.get(Bukkit.getServer().getCommandMap());
i really dont understand why it worked now
you're new to reflection, right?
then it's a static field
how can i access an instances member
I will explain later, I have to go grocery shopping now
google difference between "getField" and "getDeclaredField"
it'll probably answer your question
I gotta go now, will be back in 30-40 mins
quick q, there's no way through the api to get a full list of blocks in radius for an explosion event right? only the ones that blew up?
not really, that's more coreprotect/prism stuff
you would need to know what was there before the explosion and deal with moving materials
argh give me a break
does minecraft actually raycast explosion damage?
what a weird way of doing things
why not just do a volume?
minecraft explosions are weird in general
after a certain set size the only thing that increases in an explosion is the length of the shockwaves
ok so to reimplement explosions I'd have to listen to the explosion, cancel it, raycast my own explosion vectors, come up with my own math for block resistance and then ship that in my own explosion event huh
mhm
and I guess also my own math for attenuation
isn’t there just an event though for when a block gets exploded?
the raycasting part sounds exceptionally inefficient
painfully annoyed that after like 64 explosion size it just does this
yeah
I know
how about I just invent my own new method called volumetric stepping
I just go through all the adjacent blocks and kill progression when it would no longer explode
each block carries its own vector, and the explosion propagates to the direction pointed towards; that should work
math
that's a lot of large words
I mean really this is basically how real explosions work, I'm basically describing a wave
water an lava just need increased attenuation values
I don't really care about falling blocks here tbh
this is for the context of explosions in boss fights
I'm not modifying tnt or anything like that
I suck at math so I spent like 2 hours searching for a formula and then a java implementation of a formula for my nether corruption plugin
to make it prefer points closer to the center when the diameter is big
Searching for formulas is the worst
thats what matlab or maple are for
You end up with a Wikipedia page written by 18 different rocket scientists or something and none of it makes any sense
There's more Greek letters than English ones
I kept ending up with 2d implementations and trying to make it work in a 3d implementation and failing and going back to google
was really difficult to get weighted points that prefer being closer to the center of a sphere
how can I make a quartz slab in 1.8?
setData()?
it’s just the damage value
well yeah
i think the non deprecated one is with getBlockState and then setdata
no its not
is there anyway to see which data value the quartz slab is?
also how do I change the slab from the top half to the bottom half of a block?
havent seen that anywhere either
pretty sure it’s in getblockstate as well
what do you mean
look in game
the item just doesnt work
the damage value is on the item
you should not be comparing items based on their lore
pretty sure the .equals() method on lists compares the reference
did you understand it meanwhile? 😄
every list that I know compares the elements
I've used assertEquals in my PDC library a shit ton of times during testing
at least hashmaps, hashsets, arraylists, linkedlists etc all compare the contents
yeah not that but just in general
if you make a typo or something just by one space it won’t work
identifying items by its lore is a shitty idea, I agree
for that, PDC should ALWAYS be used
now its just in the wrong area
1.8 moment
indeed
doing block rotations on 1.16.5 isn't fun, can't imagine doing it in 1.8
abit
i wonder
if i register a custom plugin command /op
do i override the vanilla in the knownCommands map?
also someone could throw a normal snowball, then move their hand over the custom one and it would still activate in this scenario
I gotta do this for all 26 letters of the alphabet too
I guess so
1.8 block data is really annoying
@tender shard is this the correct way to apply it on start? xD
everything below 1.13 is bullshit 😄
for everything
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() { public void run() { Ranks.disableVanillaOp(); } });
if you make a custom /op it'll do "pluginname:op" and "minecraft:op"
hm
nvm it isnt the same :)
I'd go with a PlayerCommandPreprocessEvent and cancel it, if it's "/op" and "minecraft:op".
im as far as to remove the vanilla commands from the knownCommands map
but i also need to create my custom implementation
i dont know if anny of you ever played skyblock but i wanna make it so there is a sing where you can write something on and it will get turend into a string. how would i do this?
a sing?
sign
sign
lol sorry
SignChangeEvent exists
but you can also send the "sign gui" to a palyer
using API
declaration: package: org.bukkit.entity, interface: Player
yeah that method works for making sign input
thanks
the only thing is that you have to get the response with packets
and there’s a lot of bugs with it
if you’re making a sign gui, you probably don’t want to use a real sign
so it would be a client sided sign
true but you could just create one at an arbitrary place
yeah that’s what some people do
but then there’s bugs with that like block deletion
and the fact anyone could just come along that sign and change it
so what line of code would i use to open a sign
it depends on what your intent is really
the main idea is this:
getDeclaredField returns any field from exactly that class. if you call it on Player, you can get ALL private, etc fields that are declared in Player. However, in 99% of cases you have a CraftPlayer and not a player
so i want people to give a name for the a shop by clicking a sign in gui
hm
imagine this:
A.class has a private field "something" and a public field "publicSomething"
B.class extends A.class and has a private field "someThingElse"
You can get the public "publicSomething" from both class A and B using getField
But you can only get either "something" using getDeclaredField on class A, or get field "somethingElse" usig getDeclaredField on class B
ive figured i cant remove any commands onLoad() because thats where theyre instantiated so i decited to run it as sync task like this ```java
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { public void run() { Ranks.disableVanillaOp(); } });
xD
so basically: getField returns an ACCESSIBLE field no matter if it's from exactly this class or a super class.
getDeclaredField returns ANY field but it has to be defined directly in this class
hmm
so if you wanna access private fields, always use SomeClass.class instead of someObjectThatYouThinkBelongsToClass.getClass()
kk
because the object might as well belong to a subclass
in that case you’ll want to do it by packets probably
When saving data like a currency to files is it better to save to a yml file or should I make a json formatted file? Really looking for the most efficient and commonly used way that it is done.
Field cmdsField = SimpleCommandMap.class.getDeclaredField("knownCommands"); get the field of that class
yes
(Map<String, Command>) cmdsField.get(commandMap); ```txt
get the specified class of the target instance
yml is used most commonly in spigot just because the dependency comes with it
exactly
it’s your choice really on whichever you find better
alright thanks
yaml and json is pretty much the same
how would i do that?
hehe teye
yaml is more readable so if you want admins to be able to edit it, use yaml, otherwise use json
but for currency stuff I'd much rather use a DB
since it probably changes very often
you could either use protocollib or just normal packet sending and reading
well this is how far i am ```java
public static void disableVanillaOp()
{
try
{
Field mapField = Bukkit.getServer().getClass().getDeclaredField("commandMap");
mapField.setAccessible(true);
SimpleCommandMap commandMap = (SimpleCommandMap) mapField.get(Bukkit.getServer());
Field cmdsField = SimpleCommandMap.class.getDeclaredField("knownCommands");
cmdsField.setAccessible(true);
@SuppressWarnings("unchecked")
Map<String, Command> cmds = (Map<String, Command>) cmdsField.get(commandMap);
cmds.remove("minecraft:op");
//cmds.remove("op");
cmds.remove("minecraft:deop");
//cmds.remove("deop");
cmdsField.set(commandMap, cmds);
mapField.setAccessible(false);
mapField.setAccessible(false);
}
catch (Exception e)
{
e.printStackTrace();
}
}
a way to create the sign could just be sendBlockChange and then use the openSign method
you don't have to set it accessible(false)
and ik its still buggy
i would probably recommend searching a tutorial on how to read incoming packets
hm
you know what
I just found out that I use the commandmap myself in my lib
i thought its prob a good idea to restore the protection
I totally forgot about that
xD
The way im doing it right now is that when server starts the amount that have goes into a hash map then when server stops it gets saved to file with a DB would I be able to just live update from player to DB and call from it instead of doing the hash map? or is it sill a good idea to use the hash map?
it's not "protected" if every plugin can change it with 2 lines anyway
yeah but what if the server crashes and players lost all their currenc yprogress
they'll be upset then
but will it show a sign for other players then?
no
im used to do that from C++
sendBlockChange is client side
cause u can cause a memory violation otherwise
do you know anny good tutorials?
on packet reading?
yes
i’ve seen a few on youtube
Now would calling directly from a DB be slow or would it be more efficient than loading the map every time
in terms of efficiency probably the map
but you should probably save it to db every few minutes or so so players don’t lose all their progress if the server dies
yeah thats what I figured thanks for the help!
for some reason the first if statement fails when i try to click the item again. So when i click a item twice it disappears and then the first if statement is never true therefore i can't choose the item
in java you can basically only cause that using sun.misc.Unsafe lol
in case anyone wants to crash the JVM, here you go
hard to tell what that's even supposed to do - why are you creating a new hashset everytime?
if (AmogusSkinner.list.contains(event.getEntity())) {
Player player = event.getEntity();;
event.setDeathMessage("");
event.setKeepInventory(true);
AmogusSkinner.list.remove(player);
player.spigot().respawn();
}
}``` it still drops their items but keeps their inventory, so basically duping. Also it isn't respawning them.
because if a hashset comes smaller than the queue it means that there is a duplicate (hashset contains the same elements as queue)
ive managed to override them
the commands
cmds.replace("minecraft:op", new OpCommand("op"));
cmds.replace("op", new OpCommand("op"));
cmds.replace("minecraft:deop", new VersionCommand("version"));
cmds.replace("deop", new VersionCommand("version"));
cmdsField.set(commandMap, cmds);
and then ive created a new vanilla command inheriting BukkitCommand like the /reload command does
and hooked it to the op command
wont work for autocompletion of other commands but suffices to re-route the execution of that command completly
wait a tick before respawning them
not a great solution though
you would be better off just checking entitydamageevent check if the applied damage is less than 0, then teleporting them
would also fix the inventory dupe problem
wouldn't it be easier to use a queue like data class that doens't accept duplicate elements in the first place?
so @tender shard after a long road ive managed to override the /op command xD
ive replaced the BukkitCommand with custom written ones instead of deleting the key
and used the ReloadCommand class as temple
also ty for your patience xD
despite me nagging xD
np lol
WHAT IS ? ON JAVA
Either a generic wildcard or used in ternary operator
can u ebolarize
i don’t think that’s a word
elaborate*
google dot com > java generics
String asd = true ? "asd" : "not-asd";
asd is "asd" now
if true would be false, then asd would be "not-asd"
it's basically the short form of
String asd;
if(true) asd = "asd";
else asd = "not-asd";
can someone help me make a plugin to basicly save the item in a item frame using this
https://github.com/JEFF-Media-GbR/MorePersistentDataTypes
i am new to tis
this
i have 0 experience
...
Imagine
Why would you even need it?
Like-
Eh
Too complicated
And food lage
Too late
to save what player e.g. owns an entity
Just save owner's uuid
Player owner = entity.getPersistentDataContainer(key, DataType.PLAYER);
sure, you can do that. but
- you can't get a player object from a UUID if they are not online
- there's no builtin data type for UUID either
Heyo! How can I deploy my plugin to vps after building using intellij?
Could you not do that originally 😳
I mean you can save a Player object into a PDC
Oh
of course a player implements PersistentDataHolder
I thought you meant
no that's not what I meant 🙂
Like storing data into a player
of course that is builtin 😄
Lol
- OfflinePlayer stilll exists (correct me if I'm wrong)
- You could transform it using UUID methods to string
Yea why don’t you just save the players uuid
And then grab a player via uuid when needed
it does exist, but what if you need a player object?
offlineplayer always exists even if they dont
sure, but why convert it manually when you could just directly store the UUID
How do you want to store something that doesn't exists?
obviously you store it while the player is online
If a player is offline, how can it be saved..
then you can retrieve it when the player is offline
hi does anyone know how to make ur own custom ip for free using spigot
What
also player was just an example, I know it's not very useful to store a player in a PDC
Yeah
but what about stuff like... string arrays? itemstacks? HashMap<Integer,ItemStack>?
I just used player as example because I was told to "pdc myself" 😄
Object storing itself?
no, a player implements configuratinoserializable
it only stores what bukkit serializes it to
(which is basically only the name lmao)
but it still allows you to get a player object
even when the player is not online
help i am stupid child
Idk ask this pdc guy
you won't get any plugin done if you don't know the basics
do you know if your keyboard is dvorak or asdf?
you basically just have to do
myEntity.getPersistentDataContainer().set(someKey, DataType.ITEM_STACK, theItemStackYouWantToStore);
to store an itemstack inside an entity
that's all you need to store it
wait this is a only 1 line of code?
no
well
yes
to store an itemstack, yes
to achieve everything you want to do, obviously no
your whole plugin would likely be about 20-30 lines of code in total
unless you wanna serialize the itemstack yourself
then it'd be about 50-60 lines
yes storing the literal player object reference for longer than what it is valid results in a bad memory usage and is also (a) candidate for plausible memory leaks
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
ok
player is configurationseriazable
it simply stores the name lmao
if i need a little help with the code can you help me?
I wasnt talking about yours tho
I'm just confused as to how bukkit can create a player object by just the name if they are not online
No need to be rude here
because they exist even if they dont
no u
Ahhhh
they both expect the same object
That's why you can get them
good luck getting a player object if they are not online
Literally, if you don't care about what someone says just ignore it, don't be a douche prompting them with meaningless messages
I imagine Mojang (or MS) has something in mind similar to Discord's (note that Conclure is not online)
to get their inventory? their permissions? their current potion effects? ...
their location...
the list is long
well bukkit/server in general does cache uuid -> name for a said amount of time
You could do everything that In a queue whenever this player joins
and what if you need it now?
Then you would have to just store what you need
how would i do that?
exactly. and that could be avoided by having a player object
I think we are just creating problems from not existential problem
Saving entire player object is kinda overkill
noone ever said anything about saving the object
but about serializing the player
Hi 2 hex
has an idea for 2Hex a Serializing Killer :P
D:
hi
I am going to go with erasing mfnalex's player serialization
myeah, mfnalex I can see it being most useful if you wanna sync blobs of player data between different nodes, then your pdc type pretty much cut out all the work for it
i tbh don't think that the player PDC data type makes ANY sense
it does
I only included it because Player implements ConfigurationSerializable
of course depends on to what extent
I have never tried whether it actually returns anything useful 😄
public static void setup(){
file = new File(Bukkit.getServer().getPluginManager().getPlugin("CoordinatePlugin").getDataFolder(),"coords.yml");```
but lets say you want to sync the player between two faction servers
why am i getting Method invocation 'getDataFolder' may produce 'NullPointerException'
yeah if it'd would actually work, it might be useful for stuff like that
I just haven't ever tried if it actually works
have any idea on how i can do this?
but theres potential to say the very least
IIRC only the name lmao
oh
getPlugin could be null
thats tragic
I'll have to try it tomorrow
how do i make sure getPlugin cant be null?
yeye keep me informed
check if it's null
You just check if it's null before using it
will doooo 
🙏
if(Bukkit.getServer().getPluginManager().getPlugin("CoordinatePlugin") != null){
file = new File(Bukkit.getServer().getPluginManager().getPlugin("CoordinatePlugin").getDataFolder(),"coords.yml");
}```
the error still shows inside the if statement
It doesn't know that it won't be null the second time you call the method
i was trying to follow a tutorial on custom files, and he didnt get the error that i got
It's not an error it's a warning
You can ignore it if you want
Eitherway I recommend learning some Java basics before starting with Spigot development
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
im just confused on saving/reloading data for spigot
i already have my plugin finished
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
?learn
small question about EntityShootBowEvent
if (event.shouldConsumeItem()){
double saveChance = 0.5;
if (Utils.getRandom().nextDouble() < saveChance) {
event.setConsumeItem(false);
arrow.setPickupStatus(AbstractArrow.PickupStatus.CREATIVE_ONLY);
}
}
When shooting the arrow the item gets consumed, but the arrow also becomes not possible to pick up. no other event.setConsumeItem() occurs anywhere after in my code so the change is not being un-done, how does this work?
not aware that you can pick up non-dropped arrows
yeah you can pick arrows up when shooting them with a non-infinity bow
that must be specific to java then
this isnt a bedrock feature?
i guess it assumes it was shot with infinity.
if ur rlly want i guess u can set it manually https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/AbstractArrow.PickupStatus.html#ALLOWED
declaration: package: org.bukkit.entity, interface: AbstractArrow, enum: PickupStatus
anyway, strangely this only occurs when shooting with a normal bow, im implementing custom arrows and i made it so these arrows will still be consumed when shot by an infinity bow. this works, and the isConsumed property is now true and it still passes the if check in this code block, but now arrows shot from a normal bow aren't able to be picked up while also being consumed
Previously shot arrows
Arrows shot by players can generally be picked up.
Arrows cannot be picked up if:
It is shot by a creative mode player.
It is shot by any mob able to shoot arrows, such as skeletons, strays, pillagers, or piglins. This includes mobs that do not shoot arrows in normal gameplay, such as illusioners and bow-wielding wither skeletons.
It is shot with an Infinity-enchanted bow.
It is one of the two extra arrows shot with a Multishot-enchanted crossbow.
its not the pickup status im worried about, i just want these arrows to not be consumed when the random check passes
Heyo! How can I deploy my plugin to vps after building using intellij?
upload
I mean automatically. I want to test my plugins on my hosted server
write a script to upload it - alternatively you could use the debug setup
i dont think im being clear enough.
i have custom arrows that use the Material.ARROW type, and i want them to be consumed by infinity and also be pick-uppable. This works
i also have a "chance to not spend an arrow when shooting" stat that overrides this, where the arrow becomes not pick-uppable and the item is not consumed
for infinity bows this works fine, saved arrows aren't consumed and spent arrows are, saved arrows become impossible to pick up while with spent arrows this is still possible
for normal bows saved arrows are still consumed while also impossible to pick up, spent arrows are still able to be picked up
Show code lol
AbstractArrow arrow = (AbstractArrow) event.getProjectile();
if (arrow is custom){
event.setConsumeItem(true);
arrow.setDamage(custom damage);
}
if (event.shouldConsumeItem()){
double saveChance = arbitary chance to save ammo;
if (Utils.getRandom().nextDouble() < saveChance) {
event.setConsumeItem(false);
arrow.setPickupStatus(AbstractArrow.PickupStatus.CREATIVE_ONLY);
}
}
i mean its moreso confusing that the pickup status is updated but the consume item status seemingly isn't
because i cant pick up the arrow but it's still being consumed
how can you consume or unconsume an arrow after you have already initiated using it?
you said you were using the shoot bow event
yeah
the arrow has already been allocated and assigned
events happen before the actual thing happens in game and changing the properties of the event changes the outcome of what happens in the game
how would that explain what im experiencing though
i have 4 test cases, no infinity normal arrows, infinity normal arrows, no infinity custom arrows, and infinity custom arrows
all except infinity custom arrows are working
oh dude
what the fuck lmao
its a visual glitch
the arrows arent being consumed they just look like they are
the client is confused
when i click the item in my inventory it gets updated to its intended amount
I should really finish my bow code i guess, however I use the projectile event
Are you calling updateInventory by chance when editing items in the inventory
im not editing any items, just letting the vanilla game/spigot handle item consumption
but im not
is updateInventory() an expensive method or is it allright to call on an EntityShootBowEvent
It shouldnt be an issue IMO iirc its just a client sided update
basically the server tells client to refresh inventory
just make sure the entity == Player that way you not calling it on skeletons per say
mhm already asserted that
Sounds good, try calling updateInventory and see if that fixes the visual bug
thanks for the help fellas, good to keep in mind that it'll only appear your code is broken
I didnt read the whole issue, but i figured that could possibly be the issue here :p
do you reckon this could be a bug worth reporting to spigot because it feels like a minecraft issue
I do not beileve do, especially if updateInventory fixes it
I would blame mojang if so
^
figured as much
Search on Jira maybe it's known
awesome, its just likely due to how MC handles the clients updating inventories
Visual bugs with Inventory are so fucking common
i feel like thats because companies force their programmers to work a specific way thats very very slow but more healthy for the program
i bet MC's source code is a total hell hole
oh it is
I believe in competence of programmers, if someone fails it's usually supervisors
Programmer only does what he is told
Just see it
its like they wrote it in moon runes
You will find stuff like minimum loading time of 2 seconds hard coded
oh god
Even NASA pc must wait 2 seconds, no exceptions
fantastic
but yeah they may be setting their priorities wrong or focussing too much on content rather than the overall health of the game
havent tried that one yet
but they cant change too much because spaghetti garbage
oh beautiful
Who cares about the game, just add 100 skin packs to bedrock
can’t forget all of ghost items/blocks
cancelling blocks burning in lava
i mean it makes sense, java edition doesnt make them their bank
but still bedrock is somehow littered with bugs
i fucking hate ghost blocks with pickaxes that are super fast god damnit
honestly not even worth using bedrock edition
thats been a bug ever since MC was created
is realms that profitable?
hiring a server is so much cheaper and more flexible
cant do shit with realms
yeah but it’s simpler for people to pay microsoft 5$ than go through the entire server process
fair enough
realms server customizability is aids
good for kids i guess
no spigot allowed
there’s a few fun realm maps but that’s it
^ was just typing that
But if you wanna customize even just basic server properties good luck
gamerules sure but any configs or whatnots goodluck
also realms just don’t work half the time
my friend bought one and tried to invite me and it just
didn’t show up for me
iirc i think you actually can
im prolly wrong though
id hope so
yessir
datapacks is like the one form of "modding" acknowledged by mojang, would hope you could add datapacks
looked around on the spigot docs, there doesn't seem to be any way to put a slab on the lower half rather than the upper half, or vice versa, is there?
i have no clue why people create data packs they’re so annoying to make
i asked here earlier, and told its in the getState, but couldnt find a way to change it
some people are so damn good at that, ive seen full on world gens made from them and even custom blocks with custom biomes
Block#setBlockState
?
man if you've seen terralith or nullscape its so insanely good
declaration: package: org.bukkit.block.data.type, interface: Slab
trying to make an A
declaration: package: org.bukkit.material, class: Stairs
check if state == that
the stairs are fine
You can set a slab type with Slab here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/type/Slab.Type.html
declaration: package: org.bukkit.block.data.type, interface: Slab, enum: Type
TOP and BOTTOM are options with Slab#setType(thatDocAbove)
check here zack
huh
and then use the Slab instance you have and setType to Slab.Type.TOP
sec
ill write a example
if (b.getState() instanceof Slab) {
final Slab slab = ((Slab) b.getState);
slab.setType(Slab.Type.TOP);
}
i got a lot more letters to go after this :(
In case you didnt see this @mint mesa
Because its something that isnt changed, its just my style of code
if you wanted to
you could do this:
probably should have an abstractletter class or something
if (b.getState() instanceof Slab slab) {
slab.setType(Slab.Type.TOP);
}
but thats only for JDK 16 iirc
arent they just command blocks but worse
ah 14
yea..
NMS/Reflection it is
i am pretty sure setData will work…
yeah for this youll need to use Data
plugins in 1.8 are pain
however it requires bytes.. and I got no clue which byte to use
no pdc
it’s on the damage value of the item
yea no sorry its just that I own a server in 1.8, and im just testing out stuff, so 1.8 is what I usually use
pretty sure you can just f3 and look at it
ik lol i use 1.8
it doesnt
you can use the /data command and fire out the byte value from there
oof
sec imma google this
not much i could find
I only found this: https://bukkit.org/threads/setting-the-up-down-orientation-of-a-halfslab.135195/ which isnt very helpful
honestly just mess around with the byte value close to the one on the item until it works
^
should only be -2 or +2 away

1.8 api be like
fr
quick "upper slab" search on spigot forums
and simple fix
now lucky me can go onto "B"
depends, with datapacks you can directly alter the world generation or loot table json files already present. This doesnt actively run anything so in this aspect I think datapacks are more efficient than plugins typically are, but when it comes to adding new content to the game datapacks essentially boil down to command scripts that constantly run so they're just similar to those "single command block creations" that were hip a while ago condensed to a datapack rather than a world structure
My turn:
So this is rather a tricky question but I want to know if this is possible with packets/reflection/NMS
Say you have a Custom enchantment that will extend/implement the Enchantment class and register the enchant via reflection to the Enchantment map, and you want to apply this enchantment to a EnchantTable to be able to apply this enchantment in a "vanilla feel"
I've done my fair share of research, and notice that the client handles previewing enchantments differently on the enchantment table as well as applying this said enchantment
Now for applying the actual enchantment, this is rather easy as we can just cancel the event and apply our own result item
My main issue will just be having the enchantment show its name on the enchantment table
TLDR: Can you change enchantment names previews in the enchantment tables (The 3 enchantments on the side) with your own Enchantment class extending the vanilla Enchantment class
you cant
because enchantment names are something that are translated by the client to whatever language the client has selected
you cant make custom enchantments exactly like how vanilla ones work, you can only get quite close to it
i made a plugin like that, it needs some maintenance but it still works
May I introduce... A
its called enchantssquared if you're interested in looking
For this it appears you can just set this via extending Enchantment and overriding getName no? Or is this just for the enchantment name applied to the item i suppose
getName() doesnt actually return the name visible on the item
its basically just an internal tag
Does it allow preview of enchants in enchantment tables or nah, thats basically all i am trying to replicate here
Also i dont see a github link for that plugin sadly :((
also wasnt getname deprecated because the enchantments are now keyed
no that also isnt possible
i think i put the github in the page itself rather than on the top
Good point tbf, im just going off of this spigot thread post: https://www.spigotmc.org/threads/adding-custom-enchants-into-an-enchanting-table.378581/
ah yes found it
If im unable to set the names for previews though then its likely ill just create my own GUI
I have an enchantment API that can add enchantments in the table.
i really dont think thats possible lol
They'll never be displayed, but they can be added as secondary enchantments.
ahh dang
You can't display them without a resource pack afaik
yeah thats exactly what they want
Maybe not even with that.
Yeah i know how to do everything else, its just getting them to display in enchantment tables
Alrighty so then creating a custom GUI would be best way of handling this then i presume
Probably yeah
having to make a custom gui for it sucks because then it doesnt feel like vanilla any more
its pain
Yeah thats why i didnt want to make a custom gui for it, it really sucks minecraft is so limiting in the stupidest of ways lmao
Anvils are a similar way, with handling things on the client side lmao
anvils fucking suck to work with
Yeah indeed it does make sense, just wish there was a way to simply "override" these
tell me about it
why must a PrepareAnvilEvent fire several times depending on which item slot was clicked
why
Anytime someone tells me they have a bug with anvils, or I have to create something for anvils i just know imma be working on it all day
and for some reason each of those events is different so one event overrides the other
dont forget it being called randomly for no reason even though you didnt do anything
or when typing in the bar it also fires the event
spamming events goes brrrrt
you know what funny also
my anvil shit would bug the fuck out if you clicked an anvil slot in a specific way
like on the corner of a slot and it just wouldnt work
and if you wanna try to get your custom anvil stuff to cost exp good luck with that because its only gonna work half the time
why? Only god knows why
im getting regular bug reports from my users saying stuff gone wrong with the anvil and im just like not again
i had someone yesterday come with a bug for anvils as they were using geyser/floodgate
luckily
geyser/floodgate anvils are already bugged on theyre end
so I didnt have to do anything for that 
working with anvils on 1.8 is even more aids as they dont have PrepareAnvilEvent
amazing
i actually gotta make a gui specifically so bugrock people can even combine enchantments
awesooome
hey so am geting this error
Caused by: java.lang.NullPointerException: Cannot invoke "online.shakiz.kprac.arenaManager.ArenaManager.worldIsUed(org.bukkit.World)" because "this.arenaManager" is null
this is where the error is :
onGoingSetups = new LinkedHashMap<>();
arenaManager = plugin.getArenaManager();
Bukkit.getServer().getPluginManager().registerEvents(this,plugin);
}
public void addSetup(Player player){
if (!onGoingSetups.containsKey(player.getUniqueId())){
if (!arenaManager.worldIsUed(player.getWorld())){
onGoingSetups.put(player.getUniqueId(),new ArenaSetup(player.getWorld(),player));
}else{
player.sendMessage(Utils.CC("You cannot do this as the world is already used on a different arena or setup."));
}
}else{
player.sendMessage(Utils.CC("&cYou cannot do this,as you already have an existing ongoing Setup"));
}
}```
and my onEnable:
```private ArenaManager arenaManager;
@Override
public void onEnable() {
ConfigManager.setupConfig(this);
this.arenaManager = new ArenaManager(this);
getCommand("setup").setExecutor(new SetupCommands(this));
Bukkit.getServer().getPluginManager().registerEvents(new ArenaListeners(this), this);
}```
i am convinced after all the time i spent looking at this to fix it that if theres an issue its not on my code ;-; (ik it is but yeah)
it looks like you didnt call SetupManager yet
wdym
public ArenaManager(KPrac plugin){
setupManager = new SetupManager(plugin);
arenas = new LinkedHashMap<>();
profileManagers = new LinkedHashMap<>();
}```
arenaManager = plugin.getArenaManager() within your setupmanager method
setupmanager doesnt seem to be called yet so it is null
oh its a constructor nvm
i ran this command and got the error
if (!arenaManager.isInGame(player.getUniqueId())) {
World world = null;
if (args.length == 1) {
world = player.getWorld();
}
if (args.length == 2) {
world = Bukkit.getWorld(args[1]);
}
if (world == null) {
player.sendMessage(Utils.CC("&cCouldn't find this world."));
} else {
if (setupManager.worldIsUsed(world)) {
//get the player back to continue setup.
} else {
setupManager.addSetup(world, player);
}
}
}
}```
i got the same error on other projects and i cant find it there aswell in the same way
:<
how is arenamanager instantiated in your command class
private final SetupManager setupManager;
public SetupCommands(KPrac plugin) {
arenaManager = plugin.getArenaManager();
setupManager = arenaManager.getSetupManager();
}```
If arenamamager is null there should be an error the moment you start your server
do you see any
nope
i have this but its always there no matter what plugin i use
i dont think its related
its even before the plugin is enabling
ah its find thank you bro
rip me
anyone ?
How do I check if arg 0 is a player or if its a string
if (Bukkit.getPlayer(args[0]) == null) then its not a player i suppose
or getPlayer
That's not going to work
what why
Maybe read the docs
oh f
anyway
mb
help 😭
wait what are you trying to achieve ?
if(arg0) is a player
then like do thing
else if isnt a player then like
also do things
Player player = Bukkit#getPlayer()
if player != null: dosomething
else dosomethingelse
@vocal cloud can you help me with this please
Firstly worldIsUed should be worldIsUsed?
Do you have this on github. Your code is really hard to follow
getArenaManager is returning the instance and not null?
this
Log after it's set and log in the get
import online.shakiz.kprac.arenaManager.ArenaManager;
import online.shakiz.kprac.arenaManager.setup.SetupCommands;
import online.shakiz.kprac.listener.ArenaListeners;
import online.shakiz.kprac.utils.ConfigManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public final class KPrac extends JavaPlugin {
private ArenaManager arenaManager;
@Override
public void onEnable() {
ConfigManager.setupConfig(this);
this.arenaManager = new ArenaManager(this);
getCommand("setup").setExecutor(new SetupCommands(this));
Bukkit.getServer().getPluginManager().registerEvents(new ArenaListeners(this), this);
}
@Override
public void onDisable() {
}
public ArenaManager getArenaManager() {return this.arenaManager;}
}
Well your error says otherwise no?
ok am logging it
java.lang.NullPointerException: Cannot invoke "Object.toString()" because "this.arenaManager" is null
at online.shakiz.kprac.KPrac.getArenaManager(KPrac.java:35) ~[?:?]
at online.shakiz.kprac.arenaManager.setup.SetupManager.<init>(SetupManager.java:26) ~[?:?]
at online.shakiz.kprac.arenaManager.ArenaManager.<init>(ArenaManager.java:26) ~[?:?]
at online.shakiz.kprac.KPrac.onEnable(KPrac.java:20) ~[?:?]```
okay
Place it after you initialize it in your methods and in your getter
[23:16:18 INFO]: [KPrac] is null: null
[23:16:18 INFO]: [KPrac] is null: null
[23:16:18 INFO]: [KPrac] is null: online.shakiz.kprac.arenaManager.ArenaManager@2a470628
[23:16:18 INFO]: [KPrac] is null: online.shakiz.kprac.arenaManager.ArenaManager@2a470628
[23:16:18 INFO]: [KPrac] is null: online.shakiz.kprac.arenaManager.ArenaManager@2a470628```
uhhh
where are you putting them
public void onEnable() {
ConfigManager.setupConfig(this);
this.arenaManager = new ArenaManager(this);
getLogger().info("init: " + arenaManager);
getCommand("setup").setExecutor(new SetupCommands(this));
Bukkit.getServer().getPluginManager().registerEvents(new ArenaListeners(this), this);
}
@Override
public void onDisable() {
}
public ArenaManager getArenaManager() {
getLogger().info("getter: " + arenaManager);
return this.arenaManager;
}```
onGoingSetups = new LinkedHashMap<>();
arenaManager = plugin.getArenaManager();
plugin.getLogger().info("setupManager: " + arenaManager);
Bukkit.getServer().getPluginManager().registerEvents(this,plugin);
}```
quick question, how is it possible for me to create a permission node from in game. like if i were to do /permission create permission
how could i register that permission in plugin.yml
[23:19:20 INFO]: [KPrac] setupManager: null
[23:19:20 INFO]: [KPrac] init: online.shakiz.kprac.arenaManager.ArenaManager@661476dd
[23:19:20 INFO]: [KPrac] getter: online.shakiz.kprac.arenaManager.ArenaManager@661476dd
[23:19:20 INFO]: [KPrac] getter: online.shakiz.kprac.arenaManager.ArenaManager@661476dd```
When is your setup manager initialized
setupManager = new SetupManager(plugin);
arenas = new LinkedHashMap<>();
profileManagers = new LinkedHashMap<>();
}```
Oh ofc it’s gonna be null
Idk if you figured it out
Ye
Well one way is to ascend setup manager such that it’s in KPrac.java
Another way would be to pass your ArenaManager directly
yeah amma just initialize it onEnable
after arenaManager
Alr
passing through constructors though is mwah
?
what
thanky ou
what do you think of my code
like is it good or messy
i tried myself to make it good oop code
It’s a bit under average but on the better side in terms of just a spigot plugin
in conclusion your code doesnt look good
better than mine when i first started tho
Like there are good things about your code, but some parts could be designed better imho
i dont understand how to make it better and am trying to figure it out
Well first of all you don’t have particularly much code there
So it’s hard to give a thorough and justified assessment
oh yeah i understand
well thank you conclure you are the best || i still remember when you taught me to use constructors||
But for instance passing your KPrac to every other class is violating your abstraction hierarchy and is arguably causing bit much coupling in terms of design merely
Oh yeah that was a while ago, you’ve definitely become a lot better since last :3
so i need to make is static ?
also thanks
then how can i pass it trough
But for instance let me give you an example
class PluginDerivative extends JavaPlugin{
Dependency dependency;
SomeManager someManager;
OtherManager otherManager;
@Override void onEnable(){
this.dependency = new Dependency();
this.someManager = new SomeManager(dependency);
this.otherManager = new OtherManager(this);
}
Dependency dependency(){
return this.dependency;
}
}
class SomeManager {
final Dependency dep;
SomeManager(Dependency dep){
this.dep = dep;
}
}
class OtherManager{
final PluginDerivative pl;
OtherManager(PluginDerivative pl){
this.pl = pl;
}
void doStuff(){
//USAGE of Dependency
this.pl.dependency() //for instance
}
}```
Here
SomeManager is more proper than OtherManager
As you can see, Dependency is directly injected/passed
And yes wrote it on phone
Dear God
you legend
insane
People complain about static abuse but in reality the real abuse was the friends we made along the way
"Written on my Iphone using IntelliJ idea (Mobile version)"
But SomeManager is better because:
- It explicates all dependencies
- It makes the
realdependencies loosely coupled - however it may lead to longer constructors, although there are strategies for how to deal with that such as static factory methods, context objects etc
Question:
Anyone here good with knowing how licensing works for things?
Say I have something that has a MIT license, lets say TinkersConstruct mod
Would I be able to lets say, port tinkers to a MC Plugin using they're textures but not they're source code itself?
If a license is stated for the textural assets specifically then you might have to abide by that, else I believe it goes under the same license the code is put under? No?
well i see i have a lot to learn thank you man
ill try using that instead of passing the main instance
i actually somewhat understand why that
Lol yeah, well I mean something you definitely wanna understand before the arguments I made is specifically SOLID and OO principles
And then you probably wanna learn the design patterns
Yeah Shakiz
Dont see any licensing for textures themselves, there is a credits.txt: https://github.com/SlimeKnights/TinkersConstruct/tree/1.18/src/main/resources/assets/tconstruct
Im probably better off asking those devs themselves, apologies
sadly Bukkit sometimes require you to pass the plugin instance
Take BukkitRunnable#runTask for instance
or NamespacedKey
Ye fr gl

oh yeha
having issues while compiling my plugin anyone ever see this before lol I tried searching for a bit couldn't find anything. I'm probably just stupid, but the MojoExecutionException is too vague. When I looked it up all I could find was people using JRE instead of JDK, but I made sure I do indeed have the JDK installed
Error: https://paste.md-5.net/acecojecez.sql
Pom: https://paste.md-5.net/fopoqimizi.xml
If you really wanna be object oriented here you could create a middle abstraction level component which encapsulates a said plugin instance and delegates it (but let’s talk about that another time lol)
lol
yeah i gotta sleep
ty conclure again
Sleep tight :3
Seems like a code error?
In newer versions I believe JRE gets packed along with JDK
Cannot invoke "String.endsWith(String)" because "pattern" is null
theres no error in my code I don't even use String.endsWith
oh interesting
also nothings tripping sonar lint either
Have you tried invalidating caches and rebooting your ide?
People should upload their code to github for help 
I've tried mvn clean and rebooting my ide I'm recompiling my personal dependency rn to see if something weird happened
Mye, like based on the error it looks like someone put a "bad" string but I don’t really touch maven that often so not my field of expertise
this is pain lol
gradle seems harder to learn than maven
A pretty bullshit argument imo, and then given the advantage once learnt I’d say it’s worth it
whats gradle got over maven besides less verbosity
Faster in subprojects, you basically code the buildscript (as opposed to maven where it’s just a bunch of tags) given that you program/code it, gradle can offer an api without the usage of external plugins
Then of course you got a ton of plugins in case you don’t wanna lay down focus on writing and automating tasks by yourself :3
Of course one disadvantage is how every project uses a different version of the gradle wrapper because it’s updated just so often, and then it’s less established in spigot
Myeah it’s also quite unopinionated so people tend to structure things differently which can be a disadvantage as you’ll have to learn every project’s structure from the beginning (assuming you’re trying to understand an open source that uses gradle)
This command is sending an error to console and I'm honestly not sure why
The command sets your, or someone elses gamemode to survival when ran
public class customGMS implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
if(!player.hasPermission("srmod.gamemode")) {
player.sendMessage(ChatColor.BLUE + "Permissions> " + ChatColor.GRAY + "You do not have permission to do this.");
return true;
}
Player target = Bukkit.getPlayer(args[0]);
if(args.length == 0) {
player.setGameMode(GameMode.SURVIVAL);
player.sendMessage(ChatColor.BLUE + "Gamemode> " + ChatColor.GRAY + "You set your gamemode to Survival");
return true;
} else if (args.length == 1) {
player.setGameMode(GameMode.SURVIVAL);
player.sendMessage(ChatColor.BLUE + "Gamemode> " + ChatColor.GRAY + "Set " + ChatColor.GRAY + target.getName() + ChatColor.GRAY + "'s gamemode to Survival");
target.sendMessage(ChatColor.BLUE + "Gamemode> " + ChatColor.GRAY + "Your game mode was set to Survival.");
return true;
}
return true;
}
}```
Error: https://www.toptal.com/developers/hastebin/ijucowiyum.properties
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Player target = Bukkit.getPlayer(args[0])
You check the arguments length after this line
And so you don’t really check whether args[0] actually is within bounds
As the check (args.length == 0)comes after the attempted array access of index 0
Now that World.spawnFallingBlock() is deprecated, what's the best way to spawn a falling block with a specified texture?
there is so many things wrong with that I cant say all of it
Please do, if I'm doing something inefficiently or just wrong please tell me
I'm new
yeah i'm typing
for the else if part
are you trying to set the targets gamemode or the senders?
lemmie just retype that for you
ooh
yeah that code there has some issues I fixed
with variables
like when you're supposed to set someone elses gamemode it sets yours
I fixed that
public class customGMS implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
if(!player.hasPermission("srmod.gamemode")) {
player.sendMessage(ChatColor.BLUE + "Permissions> " + ChatColor.GRAY + "You do not have permission to do this.");
return true;
}
if(args.length == 0) {
player.setGameMode(GameMode.SURVIVAL);
player.sendMessage(ChatColor.BLUE + "Gamemode> " + ChatColor.GRAY + "You set your gamemode to Survival");
return true;
} else if (args.length > 0) {
String playerName = String.valueof(args[0]);
Player target = Bukkit.getPlayer(playerName);
target.setGameMode(GameMode.SURVIVAL);
target.sendMessage(ChatColor.BLUE + "Gamemode> " + ChatColor.GRAY + "Set " + ChatColor.GRAY + target.getName() + ChatColor.GRAY + "'s gamemode to Survival");
target.sendMessage(ChatColor.BLUE + "Gamemode> " + ChatColor.GRAY + "Your game mode was set to Survival.");
return true;
}
return true;
}
}```
Idk if you have to create the string playerName but that's what I usually do for command args
I spaced it out a bit for u
🥄
@idle loom
No not really
that's how I learn
I have to use code in a thingy first before I have any idea what it does
lol
Mye well I’d say the colossal issue with spoonfeeding is the fact that you can continue without knowing the actual solution
It does not enforce you to understand the solution put simply
also ur error was bcuz u defined the player target with first arg before u even checked if there was an argument
But if you’re dedicated then ye perhaps spoonfeeding might just be fine
yeah people say that, maybe I'm just built diff
Ye lol maybe
thanks
I know I figured that out
also prob bcuz I never understood a non bleb-friendly language
Np
what’s a bleb? O.o
Oh then I’m a bleb as well 
🥲
Lol

Whats the best way to handle adding in custom blocks to a plugin?
I know for the block to retexture you would use a resource pack, and most of the time i hear lots of good things for Mushroom blocks, but this would only make it so you could add in 15 different blocks according to this screenshot
but even then it doesnt seem like youd be able to do that many because you would just have a resource pack that has different texture for the stem, cap, and pore (So in reality only 3 different blocks) unless im wrong about this (I saw some spigot post somewhere that you can have 120 different texture with mushroom blocks? Ill try to find the spigot post)
Dont want to use armor stands + heads method, just seems kind of uhm, broken lmao
I know of another method, but its as weird as the armor stands one, which would be making the block covered in item frames and then retexturing a item with CMD that's inside that item frame (Probably a map?)
Last option is janky and you'd need to recode a lot of stuff
It's decent for adventure maps
But not survival
Mushroom stems and pores are decent
Yeah tbh most methods are real janky, which im fine with im just trying to find a method that would be the "least jank" if you get what im saying
And yeah any way this is done ide need to add a bunch of handling and prevent any unwanted actions which im well aware of and ready to do, just not sure the best way to handle actually handling the texturing of items
Yeah only issue is, i would only get to create about 3 different blocks if im correct about my message above? Or am i thinking about this all wrong for mushroom stems
Noteblocks are another good option
Yep i heard stuff about noteblocks too, was considering that as well
How many different blocks could you squeeze out of both of them? As i dont really see a very clear answer for this
If the mushroom blocks textures are all individuals then thats 15 blocks itself, but if mushroom blocks are handled dynamically (Stem, Spore, and cap are textured at runtime) then that would mean im only able to handle 3 different textures at one time, and i assume the same would be similar with noteblocks
Well, Noteblocks have a ton. There's 16 instruments, each have 25 notes, and can either be powered on or off. 16 * 25 *2 = 800 lol
Could calculate mushroom blocks the same way, but I'm going to just assume that the 120 calculation was probably correct, or atleast close to it.
oh wow 800 definatly does seem a lot better than 3, 15 or 120 lmao
Only issue is im not entirely sure how this would be handled out when creating the pack i would assume you would edit the ,json to point to a different texture than the original but looking through the default json files for blocks i dont see that many configurable options :c
oh neat
youtube vid for noteblocks
Perfect lol
wait hold up
this video is smart
it uses monster spawners, and you set the spawner type to armor stand that is wearing a custom textures item
and scale it up with the json files of the texture pack o.O
Today I'll show you how to essentially add any new block you want to Minecraft without having to replace any pre-existing, vanilla blocks or textures!
►Subscribe - http://bit.ly/Subscribe_Sarc
►Follow Me On Twitter - http://bit.ly/SarcTweet
───────
Other info:
───────
Commands:
/blockdata ~ ~ ~ {RequiredPlayerRange:0s}
/blockdata ~ ~ ~ {Sp...
okay yeah im definatly trying that that seems so cool
There should be a java.version variable in your maven file, or gradle file
And set the java version to lower in your intellij as well (if your using that)
?
You cant do that
If you want to support down to java 8, youll need to compile with java 8 (To my knowledge)
you could create 2 seperate java versions for your plugin, but that would mean maintaining 2 different plugin source's
Thats why i dont really like to create plugins for anything lower than ~1.14, its just too big a hassle, handling different nms, handling different java versions, handling differences in spigot api with version checks
Is there a way to check when a dropped item is moved?
EntityMoveEvent only applies to living entities
The fallacy with this is a large amount of them will degrade client and server performance
It’s a good trick to use sporadically though, though it is to be noted when you’re looking at them from a distance, they look like spawners
There’s one good, real block to use that is mineable with a pickaxe and can’t be obtained in survival: the petrified oak slab variants
It only has 3 variants, a bottom slab, top slab, and double slab
Yeah these wont be used buttloads, it will mainly just be used for a few blocks that are placeable by a player
As well as a few naturally generated ores in the world
I assume that "naturally generated ores" would cause a lot of server lag?
If it’s only a couple per chunk I doubt it
I’m talking about if players grab a shit ton of it and build houses out of it
Interesting, and how many different blocks could you create with these?
Only three, and it’s a top slab, bottom slab, and full block
It’s not a lot to work with, but I like to dedicate those to blocks I want to use en masse
True, most blocks used will just be for forging items in a smeltery type deal, i doubt players would really want to build houses out of them
The main issue is im going to need about 20ish different blocks to be added
and possibly more
So im just trying to find the most efficient way to add this many blocks without any over complicated methods and no clunkyness like with armor stands and item frames
Noteblocks are the way to go I’d say, but bear in mind that they will be mineable by axe
Indeed, i assume though you can just make an API check (ie check if block is custom ore/block) and for said ores that are spawned and allow to be mineable with pickaxes faster and make mining speed slower with axes?
I havent really touched on that part of the api yet but i assume this is something thats probably possible
The mushroom variants aren’t a terrible option either
But
It’s finicky as all hell
Because when a mushroom block is next to another block, it changes states
Well, I’ve seen it done where the mining speed of blocks was adjusted, but it’s a little funky
There’s no clear api path for adjusting it, it takes some work and there may be desync for players with low pings
All in all, adding blocks to a spigot server is a fun experience
Yeah i know either way custom blocks get implemented things are going to be finicky, im fine with the actual mining process being a little out of sync
its rough lmao
I once added an entire dimension to my server made of blocks not found in any of the other worlds
It was pretty desolate
im trying the spawner way out now, but i need to import NMS to access CraftCreatureSpawner but for some reason gradle isnt liking to import that nms jar lmfao
That sounds really cool!
Anyone know if theres a way to power a block requiring redstone to activate
oh?
