#help-development
1 messages ยท Page 2091 of 1
?
Like here
Russian?
well
When I click the barrier I want to get the next player
when you create the new inventory
do getInventroy()
oh no
Storing Player Data! | Spigot/Paper Plugin Tutorial
shush plz
thanks
come dm or
@crude loom use a hashmap
<Player, GuiObject>
Ah, yeah that will work
last time someone found out, I got roasted hard
he litreally 14
the page can be an variable in the GuiObject instance
idk
Not written for bukkit but you get the concept
*Cyperpleb java *
VALORANT when their drunk
how can I make all commands in this String clickable? whats the shortest and best way?
String message = Use <command help> to do this... or this ... <command2 dosmth arguments>!
Goal: <> all these commands to be clickable and have a hovertext
so my plan is to split it up with regex etc, but is there a shorter way?
Not really but its better to use ==
ive had it not work at all with equals
I had to fix a bug in my plugin where something wouldnt work and the fix was to change the equals to ==
in the past I had issues with == to
== works best
.equals is the only one that works with material for me
All I know is after i changed it to == it worked
You both did something wrong
prob
Survivor VS Full Netherite Hitman
oh
maybe one of ur values
was null
yea
who cares
about that one 0.01 nanosecond
bitches*
I dont get why people have that attitude to something that has benefits while taking less time than what they were doing
.equals(object) takes longer to type than == object aswell
they both have different use casesโฆ
we are exclusively talking about enums rn
well yeah for enums itโs a better idea
because people are idiots
fair
.equals() and == do two separate things
they are not the same
anyone know where I can get a list of all major releases of spigot?
frost, this is the context
doesn't matter, they are still not the same
that is correct MattMX
!!!
I know they do different things, we established that
then, it shouldn't be a case of which takes longer, rather which type of equality you are wanting to check
I was saying, that the better way to check for enums being the same is also the shorter thing to write it
no downsides, yet people still use .equals() (for comparing enums that is)
Iron_block
Diamond_block```
```if(block.getType().equals(plugin.getConfig().getString("Blocks")){```
that wouldnt work
what do I have to do
I dont see the path "Blocks" in your example config
this would depend really, constants don't have pointers or instances
Thats example config ignore it
thus .equals() would be the only way to check
however, a constant that has a value, the value can have a pointer though
frost, lets stop. we were exclusively talking about enums and its getting old
so am I
Shreb help me pls
what's the issue
youre trying to compare wether the config contains the type of block youre comparing with?
code is wrong
getString returns a string, getype returns a material
Yes I'm checking if the player broke that block, a command will be executed
could also use Material.valueOf()
Or that
cant really help without seeing the actual code since what you sent isnt a config which would work with the code
?paste
if(block.getType().equals(Material.valueOf(plugin.getConfig().getString("Block")))){
COAL_ORE:
50: #This is the percentage
- 'eco give %player_name% 50' #This is commands
- 'give %player_name% diamond 1' #Would like it to support multiple commands
50:
- 'eco give %player_name% 50' # All % has to add up to 100%
- 'give %player_name% diamond 1'```
example
or block.getType().getName()
try catch is my friend ๐
put all the code inside a try and catch Exception ignored
You guys seem so much experienced, for how much time have u been doing this things for ๐
1 year
about 8 months
spigot plugins?
damn
He's an OG
I need your time travel abilities, where they at
String blockName = plugin.getConfig().getString("BLOCK");
Block block = (Block) Material.valueOf(blockName);
if(urBlock.getType().equals(block)){
// your code
}```
Idk if that will work never tried it but that's the concept of it
@last ledge
also use a try catch
since nearly the beginning of Java
youre comparing a block to a Material
you cant cast a material to block
material is simply an enum value
try{
String blockName = plugin.getConfig().getString("BLOCK");
Block block = (Block) Material.valueOf(blockName);
} catch(IllegalArgumentException exception) {
getLogger.info("block does not exist");
}```
while a block describes a block in the world
Yeah I havent tried it
nah
lmao
I don't do much with materials
same way you can cast a CraftServer to AnnotatedParameterizedType
gonna be a classcastexception
Heres your monthly call to clean your PC if you havent in a while. fixed my fan making weird sounds by blowing on it a bit earlier
commpiter
public <F extends Enum<F>> F castByOrdinal(Enum<?> e, Class<F> fClass) {
return Iterators.get(EnumSet.allOf(fClass).iterator(), e.ordinal());
}
If anyone is curious in regards to casting by ordinal in relation to enums
Any idea im still fucked 2d days with the same problem and still cannot find the solution because the plugin doesnt either explote or send exception of what happening
@EventHandler
public void onPlace(BlockPlaceEvent event) {
Player player = event.getPlayer();
if (this.claims.getClaim(event.getBlock().getLocation()) == null) this.claims.create(new Claim(player.getUniqueId(), "test", event.getBlock().getLocation()));
Claim claim = this.claims.getClaim(event.getBlock().getLocation());
RadiusCuboid cuboid = new RadiusCuboid(claim.getLocation(), 2);
if (cuboid.contains(event.getBlock().getLocation())) event.setBuild(false);
if (claim.getUuid().equals(player.getUniqueId()) || claim.getMember(player.getUniqueId()) != null) event.setBuild(true);
player.sendMessage("You cannot build on claim " + claim.getName());
}
But really its not funny
More than 2 days and still cannot fix lmao
you haven't stated what the issue is
Because it dont know it that hwy
Literally nothing happens hen i place the protection block
so put some debug code in there
Yeah i ill do
with what you sent we don't know either because we don't know what Claim code looks like
"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.
how can i listen for a furnace open event?
Allr let me send full code
How can I bone meal all blocks in a radius 3 from x location?
prob PlayerInteractEvent
i tried and it doesn't work
I remembered skript had something like loop all blocks in radius 3
well you can do that, but probably better if you spent the time learning to debug this on your own ๐
you will come out a bit more experienced in doing so
Yeah i think my issue is that i dont put debug message
ty for your sympathy
Put some debug code so you know when each piece of code is being executed or supposed to be
when a debug message is missing or thrown depending how you code it, then you know where about the issue is ๐
use PlayerInteractEvent and check if event type is right click block then check if block is furnace
.
Idk how to do that tho lmao, I never used it
[17:58:34 ERROR]: Could not pass event BlockBreakEvent to PercentageBlocks v1.0
java.lang.IllegalArgumentException: No enum constant org.bukkit.Material.MemorySection[path='Blocks', root='YamlConfiguration']
at java.lang.Enum.valueOf(Enum.java:273) ~[?:?]
at org.bukkit.Material.valueOf(Material.java:105) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at net.pyrobyte.percentageblocks.events.BlockBreak.onBlockBreak(BlockBreak.java:26) ~[PercentageBlocks-1.0.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor2071.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:git-Paper-184]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
?paste
player.sendMessage("Success");```
there is no Material named Blocks
use the try catch thingy
I sent above
should point out, enums for materials are uppercase and casing does matter. So if Blocks does contain a valid value you need to use .toUpperCase()
no need for .equals, use ==
they don't do the same thing
mwoa your opinion lol
they are using Material.valueOf()
Frost do i forget some debug?
if(block.getType() == (Material.valueOf(plugin.getConfig().getString("Blocks").toUpperCase()))){
bRO
COAL_ORE:
50: #This is the percentage
- 'eco give %player_name% 50' #This is commands
- 'give %player_name% diamond 1' #Would like it to support multiple commands
50:
- 'eco give %player_name% 50' # All % has to add up to 100%
- 'give %player_name% diamond 1'```
CONFIG
zacken you're really helpful
to get the block do "Blocks.COAL_ORE" btw
getting blocks from config
;0
Blocks example
stone
Yeah cuz rn ur getting "Blocks" but not the actual blocks inside
don't listen to zacken I gotchu
YOu want to get 1 block or lot of blocks?
A lot of
and check player mined one of them
I want to check for all blocks
whatever people put in config
that block
while what you have said may be true, the way you are attempting to help isn't really helpful
in a demeaning way
yeah that isn't the only thing you have said either
uh
isnt blocks
forge
not spigot
nono that's in config
sorry chief
I don't wonder

Ok so idk if u can loop through everything directly inside the config but what you should do is create a hashmap
yo imagine going into a dev channel and being rude to ppl trying to help u
different breed
rip
oof
Lol, happens
but, you also succeeded in debugging it on your own too ๐
Because i tested and no debug message came, so i check main class and fin the surprise
o
Yes please
its open source
MIT even
he? But get the value of ech section
Let say:
Section:
key-1: "My value"
key-2: "My other value"
How do you get that values rom confic section
what do u want
rn
to get the underlined thing
I didnt ask you
if u have a config section
do
section.getString("key-1");
Because with config section you loop the keys but then i dont know how to get the value.
Oh ook
if u have smth like
loop through keys, u have the key now, so do getString("Section." + keyVariable)
Yeah that what i have
u have what i told u ?
๐งโโ๏ธ
Section:
section-1:
key-1: ""
key-2: ""
section-2:
key-1: ""
key-2: ""
๐ง๐ฝ
well, sure but they are asking questions that would be answered if they just looked
Example code pfff I prefer to just spend 2 hours trying to figure something out
This is my section hex
please repeat that with a different emoji or you risk extermination
getConfig().getString("Section.section-1.key-1");
Oh ok thanks :D
thats if u want a specific value
for (plugin.getConfig().getConfigurationSection("Blocks").getKeys(false)){
thats boomers talk
Can someone explain to me why after changing an object's property the hashcode of the objects changes? How does default implementation of hashcode works?
no one likes boomers talk
for (plugin.getConfig().getConfigurationSection("Blocks").getKeys(false)){ like this?
yeah i learned from copying and pasting
nah
Sometimes zacken is helpfull but he doesnt explain good what he means
i read the code
You learn from the process
that was copy pasted to me
So its diff to understand
never went out of my way to "learn java"
when someone gave me code i would read it
since u werent screamed at enough
people have it easy now
yeah but then i managed to somewhat study c# python js ts lua golang on my own
so i mean something worked
lmaoo
except golang
the implementation of hashcode in java does not guarantee the hashcode to be the same between runs or executions
ye i said that
i hate go only because bad OOP and pointers
lol
and dont get me started on c++
why
its more flexible then Java
i somewhat learned c++ then i saw u have to do some wizardry just to access an array in a function
C# was literally supposed to be a windows JVM
so then i closed out of CLion
Sun Microsystems rejects Microsofts implementation
so instead of just throwing everything away Microsoft created C#
Hex something like that?
config.getConfiguractionSection("Section").getKeys(false).foreach(key -> {
ConfiguractionSection child = config.getConfigurationSection(key);
getLogger().logInfo("Path: Section." + key + ".key-1");
getLogger().logInfo("Data: " + config.getString("Section." + key + ".key-1"));
});
yes go does not have good oop
and doesnt do inheritance
i like me some OOP
im just not used to go's oop
i mainly hate the pointers part
Now that i think, why config section doesnt have getter for values?
yes i mean that lol
doesnt it
have a hashmap return on a function
yes
Like you cannot do:
ConfiguractionSection section = getConfig().getConfigurationSection("Section");
section.getString("key-1");
no
Why u cant?
cuz key-1 is under child
of the Section
if it was
Section
key-1: "e"
then yeah
u can
then u can
Because section.getString()
what u just did
Doesnt exists
it does
I will use paste md5
Does the api allow for creating custom pathfinding for mobs? I've been looking around and it looks like anyone who has ever done it has used NMS
Because discord shity dosnt allow to paste the error
Yeah tell me?
Yeah i try
But i didnt understand the Supplier part
i believe paper does
not sure abt spigot without nms
Okay ill look into it, thank you!
anyone knows the org.bukkit.enchantments.Enchantment for sweeping edge ?
?jd
it's just called SWEEPING_EDGE
Yeah
thanks it works but I didn't see it in the javadoc
What do you think zacken?
How can I bone meal/fertilize a crop?
public void onEnable() {
if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
new SomeExpansion(this).register();
}``` main class
placeholderapi class:
https://paste.md-5.net/remejateva.java
placeholders dont work
They have their own discord for support
noone replied in 2 hours
Oh ok
So what your issue?
actually as i said that someone replied
What?
But "doesnt work" its like not problem
We need more information to understand what happening
?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.
how would i loop all the items in my config file?
for (String key : config.getConfigurationSection(path).getKeys(false))
or getKeys(true)
root section is just config.getKeys(false)
No itโs not.
A root section is a section that exists at the top of the chain. You can have multiple root sections in a YAML file.
rootsection1: true
rootsection2:
subnode1: โHelloโ
subnode2: 16
Using #getKeys(false) on the config as a whole would return rootsection1 and rootsection2.
Thatโs why you need to specify the node you want to start at with getConfigurationSection()
Using my example.
#getConfigurationSection(โrootsection2โ).getKeys(false);
It would return subnode1 and subnode2
How do I bone meal a block? I use block.applyBoneMeal() but it returns false
hello! im coming with a question, how do i check if a player crafter a wooden pickaxe then clear it, and adds a diamond pickaxe with enchantements?
Which block are you trying to use it on? Iโm pretty sure bone meal only works on specific blocks.
btw
You could overwrite the existing recipe for a wooden pickaxe and replace it with your custom pickaxe.
use Cuboid cuboid = new RadiusCuboid if u want
alright but i dont know how to make that
i could send my listener
?paste
Lmao im stressed i send to the shit the project
Im to much stressed for that shit
Youโd want to make a ShapedRecipe and set the result to be your pickaxe. Then register the recipe with Bukkit#addRecipe()
I think there's an event for the craft prepare
Too much time for a shity project that no advances i did on it
or maybe that's just for anvils
alright, imma check that
also heres my code and it isnt working https://paste.md-5.net/ezugabejog.java
yes im looking that in the plugin its registered
what's not working
cancelling the event stops you from crafting
oh yeah
I assume you are trying to replace the wooden pickaxe that is crafted?
yes
well I guess you could remove the pickaxe from the inventory on craft
you should just create a new recipe tho
wheat
?jd
or how do i add the enchant on a new pickaxe that is crafted?
Clone the result, apply enchant, give to player.
alright

How do I make the item not "use" or "bop" or whatever when im changing the nbt?
There's a PrepareItemCraftEvent
Wdym, bop?
you could try set the crafted slot to the pickaxe on that event
well its bops, just like when using a compass on a lodestone.
wait does that bop as well
hold on lemme show
make a noise?
You mean the animation played when they interact?
yeah
cancel playerinteractevent
ig
not possible
itโs client side
yeah I thought so
no urgency tho I can make the arm swing instead if I really want to
you could technically hide all nbt from being shown to the client but thatโs even more complicated
Not really. I have limited experience with blocks. I havenโt really touched the things that mess with world generation or block data.
oh
well then you are literally keeping track of the nbt yourself right
no
anyways doesn't really matter ty for the help
If someone knows the issue I get false when using block.applyBoneMeal()
using it in wheat seeds
How can I teleport a player that is currently laying on the ground?
laying on the ground wha-
yes with a fake bed you know
it's not THAT hard
maybe 100 lines of code
Sry, in particular, i mean a npc
i am trying to use https://github.com/tchristofferson/Config-Updater to update my config, but it does not update
oops i had the wrong jar
btw whats the best/fastest to start server for testing?
meant more of complicated to understand and execute properly
how can i set a persistent data container value with a variable as persistent data type?
example:
depends on what kind of variable you want to set
?paste
hello, i am using shapedrecipe but it doesnt want to work, heres the code https://paste.md-5.net/urufusuduz.java
PersistentDataType.STRING in your case
and then a string as data
yes but i want it to be a variable
cause its a function argument
so you can pass in PersistantDataType.INT and an int value or an PersistantDataType.STRING and a string value
oh wait i made a mistake
its @fresh templetlistener
im sorry for that person who i pinged-
you cant just save an object that easily
can someone help me?
damn, no one wants to help me
intellij has been loading my gradle changes for like 10m now
when is PrepareItemCraftEvent called?
is it called if no recipe is selected or matched
can someone help me?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
but sure
this is the code but i removed the @fresh templetlistener after
youre not calling the method
you need to call it like recipePickaxe() in your onEnable
its not an event
?
the recipepickaxe
because i need to check if a person
you know
crafted a wooden pickaxe
then i want it to change to a diamond pick
for that you need to use PrepareItemCraftEvent
well idk actually
i think you can overwrite the vanilla recipes
test the code with calling the method
also remove the @EventHandler
i get Caused by: java.lang.ClassNotFoundException: com.tchristofferson.configupdater.ConfigUpdater when trying to use ConfigUpdater
i think gradles not including it correctly
i did remove it after the code was posted there
oh ok
what are you using
are you shadowing the config updater dependency
just invoke the method
?
like are you using shadowJar?
oh hang on
im using https://hub.spigotmc.org/nexus/content/repositories/snapshots/
i think
?paste
maybe just paste your build.gradle.kts
you need to invoke the shadow plugin
in order to shade the dependency
no but what task are you using to build it
so it is available to you at runtime
^
theres no build.gradle.kts
you just said you were using gradle
just the build.gradle
bruh groovy is fine
"fine"
is groovy smth like maven or gradle?
aight
you need to use the shadow plugin to build
how do i do that
it includes the dependencies declared as implementation into the final jar
add
id "com.github.johnrengelman.shadow" version "7.1.2"
``` into your `plugins` block
at the top
and then instead of running build or whatever run shadowJar under the group shadow
then take the jar suffixed with -all instead of the normal ones
or you just configure build to depend on shadowJar
true
ok
also does anyone know
also am i doing this right?https://paste.md-5.net/etobonoxot.cs
Can I summon a mob that doesn't attack a specific user?
Is there a way to use the spyglass ability through code if that makes sense
like if I hit right click not using a spyglass it could still show the zoom effect
did not fix it
no
set the result to the pickaxe
as that's what you wanna get from crafting
adding the item will just put it in the first available slot inside the crafting grid
that should be client-side
so it wouldn't be possible?
you can zoom in using some fancy packets but not with the outline
!bool will return true if its not true correct?
yes
!negative = true
!true = negative
the ! inverses what's standing next to it
is there a way to listen for a crop growth event? for example when the pumpkin stem creates the Pumpkin block?
I think that's BlockGrowEvent
doesnt bool ^= true negate a boolean?
well yeah but that only gets me the crop, i also need to get the pumpkin block
I find it
funny that most people dont even know what groovy is
anyone?
declaration: package: org.bukkit.event.block, class: BlockGrowEvent
again
Ohh, like you need the block that the stem gets attached to? hmmm
wouldn't this break if there are other pumpkins near?
i want only the one that generated from the stem
Well you prob cant
thats wierd
i wanted to make custom plants by just replacing the pumpking generated with a player head
Have you tried seeing what getNewState().getBlock() returns from the event above?
i'm trying to use relative faces methodรน
So modifying bukkit methods in a async context isn't a good idea, but I can test it on events, and see if console complains?
if there aren't any error, i can assume it's safe to use or no?
How can i set a block to be a custom player head?
i have the player head as an itemstack
my logic is messed up
idk how to fix it
if (!loopPlayer.hasPermission("generalutils.kickall.exempt") && !Config.getConfig().getBoolean("kickall-exempt-enabled")) {
loopPlayer.kickPlayer(Config.getConfig().getString("messages.kickall-message"));
} else if (!loopPlayer.hasPermission("generalutils.kickall.exempt")) {
loopPlayer.kickPlayer(Config.getConfig().getString("messages.kickall-message"));
}```
wait
my brain
is dead
package me.RafaelAulerDeMeloAraujo.Listeners; import org.bukkit.event.EventHandler; import org.bukkit.entity.Player; import org.bukkit.Sound; import org.bukkit.Material; import me.RafaelAulerDeMeloAraujo.SpecialAbility.Join; import org.bukkit.event.player.PlayerInteractEvent; import me.RafaelAulerDeMeloAraujo.main.Main; import org.bukkit.event.Listener; public class Soup implements Listener { private Main main; public int vida; public int fome; public Soup(final Main main) { this.vida = 7; this.fome = 7; this.main = main; } @EventHandler public void UsarSopa(final PlayerInteractEvent e) { if (e.getItem() == null) { return; } final Player p = e.getPlayer(); if (p.getHealth() < 20.0 && Join.game.contains(p.getName()) && p.getItemInHand().getType() == Material.MUSHROOM_SOUP) { e.setCancelled(true); p.playSound(p.getLocation(), Sound.valueOf(this.main.getConfig().getString("Sound.Soup")), 2.0f, 5.0f); p.setHealth((p.getHealth() + this.vida >= 20.0) ? 20.0 : (p.getHealth() + this.vida)); p.setFoodLevel(20); if (this.main.getConfig().getBoolean("KeepBowl")) { e.getItem().setType(Material.BOWL); } else { e.getItem().setAmount(0); } } } }
who needs multiple lines
Why when KeepBowl is false the soup dont disappear
mr imajin help i need to shade this https://github.com/tchristofferson/Config-Updater but idk how
Why whe. โฐ
โฐ
How do I detect if a block is ageable?
Block block = world.getBlockAt(x, y, z);
if (block.getBlockData() instanceof Ageable) {
Ageable data = (Ageable) block.getBlockData();
System.out.println(data.getAge());
}
it literally tells you how
thats for maven
dependencies {
compile('com.tchristofferson:ConfigUpdater:2.0-SNAPSHOT')
}
thanks
Why when KeepBowl is false the soup dont disappear @quaint mantle
thats not an erorr
ik but it bugs me
im not helping u cause your code isnt even formatted
it makes it gray
how do i use water bottles for things? i know its potion but i dont know how
??
Use pdc and the consume event
Skull class should help you Google it up
If block.getState() instance of Skull
Might be PlayerSkull im not sure
SkullMeta might be another option
Yeah but i don't want to set it to a player skin, i want it to be set to a specific custom skull
Idk its changed so much over the years lol
``package me.RafaelAulerDeMeloAraujo.Listeners;
import org.bukkit.event.EventHandler; import org.bukkit.entity.Player; import org.bukkit.Sound; import org.bukkit.Material; import me.RafaelAulerDeMeloAraujo.SpecialAbility.Join; import org.bukkit.event.player.PlayerInteractEvent; import me.RafaelAulerDeMeloAraujo.main.Main; import org.bukkit.event.Listener; public class Soup implements Listener {
private Main main;
public int vida;
public int fome;
public Soup(final Main main) {
this.vida = 7;
this.fome = 7;
this.main = main; }
@EventHandler public void UsarSopa(final PlayerInteractEvent e) {
if (e.getItem() == null) { return; }
final Player p = e.getPlayer();
if (p.getHealth() < 20.0 && Join.game.contains(p.getName()) && p.getItemInHand().getType() == Material.MUSHROOM_SOUP) { e.setCancelled(true);
p.playSound(p.getLocation(), Sound.valueOf(this.main.getConfig().getString("Sound.Soup")), 2.0f, 5.0f);
p.setHealth((p.getHealth() + this.vida >= 20.0) ? 20.0 : (p.getHealth() + this.vida)); p.setFoodLevel(20);
if (this.main.getConfig().getBoolean("KeepBowl"))
{ e.getItem().setType(Material.BOWL);
} else { e.getItem().setAmount(0); } } } }``
this code seems fine to me?
using its value
like this
eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGJkM2M5NWNkMDQ4NTkxN2YxNDljM2NiZTk2MDJjYTViNmIwMjYwY2I2ZTMwMzE1Mzg1M2FiOTM4ZTRhMDViYyJ9fX0=
You essentially use player skins when skinning a skull
Even using that you set it through a player skull option
You'll have to Google it
There bunch of threads about this
oh no the formatting D:
also to me but sends that error
Imajin whats the name of that hash again he sent
i dont understand why
Ik html uses it too
probably base64
Ah yes
please https://paste.md-5.net/
Google that @midnight shore how to set skull skins via base64 hash
Should pull up a bunch of results
Iirc im pretty sure you need to use GameProfile for that, but like I said the api for skulls has changed over 5 times lmao
this is an error 3:14 PM Gradle sync failed: Could not find method compile() for arguments [com.tchristofferson:ConfigUpdater:2.0-SNAPSHOT] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. (9 s 178 ms)
i already know how to do this for items, my concern is it possible to do that also with blocks?
also say whats wrong please?
For blocks its waaaay more complex
send your full build.gradle
You need to use block states, custom texture packs, prevent state changes on those blocks
well... i need to do that so..
Sec
Why when KeepBowl is false the Soup dont disappear https://paste.md-5.net/vowiqoqure.java
but i've seen this things on Hypixel and they don't use any texture pack
They do it just loads when you join automatically
bro are you coding in notepad
why dont you have formatting
New Minecraft 1.13 secret to Adding in extra custom textures to your world, without removing any old blocks. All done using a new Minecraft 1.13 features with Note Blocks.
Watch Jansey's survival series: https://goo.gl/4Tpyjp
How to update textures in 1.13: https://goo.gl/kgiDx1
Sample resource pack: https://bit.ly/2ObhIyc
Watch Jansey's sur...
Sorry im on mobile yall
Cant remove embed
i used to code in notepad
I used this for my custom blocks feature will, it should help a ton
no no, i'm sure that there isn't any texture pack to do that
Trust me you do
ty
wha? makes sense to me
nvm
Theres no other way to add in custom blocks without using a texture pack and unused block states
In on smartphone. So i cant copy and paste the code correctly
You can use PDC and armor stand heads which is very large, but it still uses texture packs
You said blocks not skulls?
and they are placed without any texture pack
I told you how to do the heads then you said for blocks lol
becasue skulls use players head texture
i know
The Skull/SkullMeta class should work for placed skulls
i think there was a misunderstanding
?
should i use MaterialData?
Oh no are you on 1.8
For blocks meta use getBlockMeta
why ar eyou sending a screenshot
but other methods are deprecated
what does getBoolean returns?
Or getState one of the two work
hm i wonder
xD
Returns true or false
should do getBoolean()==true
@quaint mantle https://paste.md-5.net/obizeqelor.rb
declaration: package: org.bukkit.block, interface: Skull
It extends BlockMeta
So use getState on your block
why is your gradle so big
idk
im on pc so should be something wrong, but try this @small lynx
This definatly does
Click on BlockState
You'll see Skull is valid for it
Tells you everything that can use BlockMeta and Skull is there
So you use getState
How do I throw a potion with a left click action instead of a right?
i found something, tweaked a bit, but i am not sure how to do it for every type of potion
@EventHandler
public void onInteract(PlayerInteractEvent e) {
if (e.getAction().equals(Action.LEFT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
if (e.getPlayer().getItemInHand().getType().equals(Material.SPLASH_POTION)) {
ItemStack item = e.getPlayer().getItemInHand();
if (item.getItemMeta() instanceof final PotionMeta meta) {
final PotionData data = meta.getBasePotionData();
System.out.println(PotionType.valueOf(data.getType().name()));
}
ThrownPotion tp = e.getPlayer().launchProjectile(ThrownPotion.class);
tp.setItem(item);
int amount = e.getPlayer().getItemInHand().getAmount();
if (amount == 1) {
e.getPlayer().setItemInHand(new ItemStack(Material.AIR));
} else {
e.getPlayer().getItemInHand().setAmount(amount-1);
}
e.getPlayer().updateInventory();
}
}
}
BlockState* not meta sorry
^^
Looking from that its really straight forward
yeah but then how do i put that in the block? ๐
Once you change the block data its updated once you use block.getState().update(true)
has imajin forgotten me
can someone help me shade this in gradle? https://github.com/tchristofferson/Config-Updater
how do i change the block data ? ๐
Block data isn't like item meta
.
sorry i meant change
You just call the methods you need and getState().update(true)
No need to replace its meta/state
Blocks dont work like that
ItemsStacks do though
and what are this methods
my god
Shouldnt be that hard? Add your repo using his fields there
why is this so hard
I sent you the article...
im using gradle
Its not hard
.
but thats for ItemStacks
and i know not a lot about gradle
Its modifying Skull
Skull can be both a item stack or block
Im not at my pc or ide convert it for you but basically
You add the repo url to grade repository
i think you linked the wrong article then, this one changes Skull__Meta__
like this? implementation 'com.tchristofferson:ConfigUpdater:2.0-SNAPSHOT'
Yep!
well it doesnt work
Skull has a getSkullMeta method no?
it returns java.lang.ClassNotFoundException: com.tchristofferson.configupdater.ConfigUpdater
Try it it could possibly work if not
Use getBlockData() on your block https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/SkullMeta.html
declaration: package: org.bukkit.inventory.meta, interface: SkullMeta
ItemMeta has BlockStateMeta should work this way as well
can someone please tell me why i get java.lang.ClassNotFoundException: com.tchristofferson.configupdater.ConfigUpdater
It lets you cast in your ide currently though, so it should work
?
Did you add the repo too
yes
name = 'maven-central'
url = 'https://oss.sonatype.org/content/groups/public'
}```
ty really much, i'll see tomorrow how does it perform
You just import it as a normal url
ok
Not a mavel one
When you use mavenCentral() in grade it knows you want to use maven central
wait so do i do url {}?
[17:26:16 ERROR]: Error occurred while enabling PlayerKiller v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null
help
wait
maven { url = 'https://jitpack.io/' }
like that but different url
i already have maven { name = 'sonatype' url = 'https://oss.sonatype.org/content/groups/public/' }in the gradle file
are you actually creating the config file on the server
interesting
delete the new repo you added and try importing then
ok
nope didnt work
im not entirely sure then
you could clone that and compile it
and import it as a jar
huh
compileOnly fileTree(include: ['*.jar'], dir: 'libs') // Add everything in the libs folder.
Create a libs folder in your project and you can use this to import libs
ie download and compile that project to a jar
boys
and import the jar
just a random question
sup?
Very important
ok
How can i raid a whatsapp number ?
๐
like when 200 people write you
i have to do it to a person who did to me
please i need this information
@spring minnow @ancient plank
yes but for some reason it is being created incomplete... I don't really know why
?
Are you using saveDefaultConfig() as well as having the right config in your /resources folder?
do note
@quaint mantle sus person
if file exists already it wont overwrite
why
doesn't regard Discord so why you reporting mods
bc we dont wanna deal with ppl like you
;_;
man came into a minecraft help channel asking how to operate a botnet
ok gonna ignore 200 people
this is for development help anyways ^
@noble lantern how do i compile it? ive never used maven
not help me have someone channel
i mean- that actually is a answer so thanks
clean package in the mvn terminal
type mvn clean install on the terminal
or package also works
wait install works too lmfao
or just use intellij's tabs on the right
yeah i know that's why i said was a random thing, won't disturb anymore btw
why does maven have so many ways to compile lmao
tbf though a lot of those wont actually make a jar
i dont have maven
i fucked my arrow placement up
one thing that mildly bothers me is people having colorful image backgrounds on their ide
you're coding, not watchin a movie
@noble lantern mind screenshotting the WhatsApp guy and sending it to #general ?
what am i looking for
wym i watch movies when i code all the time
gotta love people coding in portuguese
meh i cba
whats saveDBConfig()
im brazilian.... my language xD
It also a distraction
I'm portuguese but I still make sure other people can maintain my code
@noble lantern what am i looking for on the right of intellij
look for the M button
Does SpigotMC offer any methods for direct downloads without being blocked through Cloudflare? At least for downloads that redirect to other pages such as Github. It would be a shame if it's virtually impossible or troublesome to download plugins without a browser.
Check spiget
wait do i open configupdater in intellij
ok
Spiget only offers direct downloads outside SpigotMC Cloudflare for latest versions. Older versions or SpigotMC downloads are still through Cloudflare
Then it's not possible
shame
lets see if you understand this... in theory you should because brazilian is similar to italian. Ciao amico come stai?
bem geralmente eu uso ingles, mas nesse caso nรฃo usei kkk apenas
let's keep the chat in english, I'm not proud of my country
man, portuguese is similar to espanol... not to italian
how do you set the players yellow number in tab
Gamerule normally
Failed to execute goal on project ConfigUpdater: Could not resolve dependencies for project
for example
no ๐ฌ
oh god
i would have no idea then
:(
i normally just make my own config updaters tbh
how hard is it
not good to rely on libs for small things like that
how exactly?
getString("path", "default value here hehehe"); on your FileConfiguration/YamlConfiguration
but i using this
You probably need nms for that, see TAB plugin code for reference
really? lol
on every value?
yep yep, if it doesnt exist it will set a default value
ok
im not entirely sure why its saving {} into your yaml
aight, thanks
Guys, I have a Listener in a separate class next to my main Javaplugin class. Is there a best-practice way how I can access fields from my main-plugin from my listener?
I feel like creating an instance of the listener class at startup just to pass the main plugin for reference is a bit... clonky
or why it would be saving just the one field and not the other one
I use static for instance
hmmm.. yeah could do
use dependency injection or static plugin instance like kacper said
That's the usage for static tho
true dependency injection
and how can i set a value that is already set
i actually change stuff lol, it's not only reading from it
static ensures that values are always loaded in memory and never garbage collected
static variables are great for constants, not for accessibility to your main
you can just setString("path", "new value here"); but normally you dont wanna do this
thatssss
youll piss people off changing theyre already set values in configs
Well theoretically
ok
someone save me
If you set the field to null, I believe it allows the GC to reclaim the memory of a previous value.
But that's only if the field is mutable.
So static final will never be garbage-collected, yes.
manual memory management
if you're manually managing your memory, just to use static
like a sane person would do
then just dependency inject
cannot resolve method set string
I mean I'm not advocating for static
Just stating that you're (partially) wrong, I'm right, ez no g
might just be set("path", ObjectHere);
havent used yaml in quite some time for editing them
make a proprietary file that you can only debug with a hex editor
like a true developer
